Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Editing the crontab

Code Block
languagebash
sudo crontab -e

Will ask you what editor you want to use

Code Block
languagebash
Select an editor.  To change later, run 'select-editor'.
  1. /usr/bin/ne
  2. /usr/bin/vim.basic
  3. /usr/bin/vim.tiny

Next is to add your cron job to the file

The cron job runs in a certain format of minute (0-59), hour (0-23, 0 = midnight), day (1-31), month (1-12), weekday (0-6, 0 = Sunday), command

As an example 

Code Block
languagebash
30 05 * * * /path/to/script

The script will run at 5:30AM everyday

A cron job can be user-defined as long as the name is added to the cron job

Code Block
languagebash
45 15 * * * roderick /home/roderick/script

At 3:45 pm everyday user roderick will run a script.