Skip to main content

1. Creating Cron Jobs

This will describe how to create cron jobs on Fedora Server to run bash scripts (That is scripts ending with .sh)

How to set up:

  • First ensure that you have created your file in a directory, let's say /home/user/
  • Then enter sudo chown user:user, to change the owner of file to your user
  • cd /home/user change directory into your home directory
  • Next enter sudo chmod +x, to give the file executable permission
  • Test run the script by entering ./
  • Verify it runs successfully, and that there are no issues
  • Next visit, and edit the values to how frequently you want to script to be automatically run
  • Next, go back into your terminal, cd, and enter EDITOR="nano" crontab -e
  • This will bring up a text file. Enter the value you configured on and then enter location of script:
  • 10 2 * * * /home/user/
  • Once your happy with what you've entered, press Ctrl + X,y and Enter to save.
  • And with thatm you've successfully set up your crontab on fedora server!

For ubuntu the steps are identical. Follow them exactly