Last active
June 11, 2022 05:27
-
-
Save iamprogrammerlk/cb7c3e4eb45b28e8c98f438ad892bf32 to your computer and use it in GitHub Desktop.
Run a program on Ubuntu at startup - A cron job setup (Tested on Ubuntu 19.10)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can use the "crontab -e" command to add a program to the cron job scheduler, | |
so that it will launch it at startup, even if there is no GUI installed (useful for Ubuntu servers). | |
# First config the cronejob | |
~$crontab -e | |
# Select the text editor (I choosed NANO by hitting 1) | |
# Next, scroll to the bottom of the file and add the following line. | |
@reboot /path/to/executable/file | |
# Example if you wanna run firefox add line like this "@reboot firefox". | |
# All you really have to remember here is ‘@reboot’. | |
# if you have a argumets to run add it after the executable path like this | |
# "@reboot firefox -O" | |
# Press "Ctrl + O" and hit Enter to save if you'r using Nano, | |
# and then "Ctrl + X" to exit. | |
# That’s it! Restart the system and see how it's works. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment