Friday, November 8, 2013

A good crontab helptext and example of executing a command every 15 minutes

# Use the hash sign to prefix a comment
# +---------------- minute (0 - 59)
# |  +------------- hour (0 - 23)
# |  |  +---------- day of month (1 - 31)
# |  |  |  +------- month (1 - 12)
# |  |  |  |  +---- day of week (0 - 7) (Sunday=0 or 7)
# |  |  |  |  |
# *  *  *  *  *  command to be executed

To run the job every 15 minutes, use one of the following valid syntaxes:

Posix-style:
*/15 * * * * /home/myuser/myscript.sh


Explicit: 0,15,30,45 * * * * /home/myuser/myscript.sh

No comments:

Post a Comment