Skip to content

Instantly share code, notes, and snippets.

@felipekm
Created December 10, 2018 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipekm/9161b5217af412008128eda9b14eb7ee to your computer and use it in GitHub Desktop.
Save felipekm/9161b5217af412008128eda9b14eb7ee to your computer and use it in GitHub Desktop.
Cronjobs in linux

To open crontab schedule

sudo vim crontab -e

Executes a script passing arguments

1 2 3 4 5 /path/to/command arg1 arg2

Executes a shell script

1 2 3 4 5 /root/backup.sh

Where

* * * * * command to be executed
- - - - -
| | | | |
| | | | ----- Day of week (0 - 7) (Sunday=0 or 7)
| | | ------- Month (1 - 12)
| | --------- Day of month (1 - 31)
| ----------- Hour (0 - 23)
------------- Minute (0 - 59)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment