Skip to content

Instantly share code, notes, and snippets.

@boobo94
Created February 21, 2018 15:01
Show Gist options
  • Save boobo94/8fde12cba002e310ba2675a06cd1544b to your computer and use it in GitHub Desktop.
Save boobo94/8fde12cba002e310ba2675a06cd1544b to your computer and use it in GitHub Desktop.
How To Add Jobs To cron Under Linux or UNIX

How Do I install or create or edit my own cron jobs?

To edit or create your own crontab file, type the following command at the UNIX / Linux shell prompt: $ crontab -e

Do I have to restart cron after changing the crontable file?

No. Cron will examine the modification time on all crontabs and reload those which have changed. Thus cron need not be restarted whenever a crontab file is modified.

Syntax of crontab (field description)

The syntax is:

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

1 2 3 4 5 /root/backup.sh

Format:

* * * * * 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