Syndicate content

crontab

Jun 07
0

Show crontab for all users

Mon, 2010-06-07 15:23 — superuser

To see crontab for all users use the following

for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done

Dec 07
0

Crontab example

Thu, 2006-12-07 21:09 — superuser

To edit crontab firstly run crontab -e

You might all this below useful to have a reference in the file itself, it's fairly self explanatory

# (Use to post in the top of your crontab)
# ------------- minute (0 - 59)
# | ----------- hour (0 - 23)
# | | --------- day of month (1 - 31)
# | | | ------- month (1 - 12)
# | | | | ----- day of week (0 - 6) (Sunday=0)
# | | | | |
# * * * * * command to be executed
0,20,40 * * * * /var/www/scripts/cron-curl.sh 2>&1 >> /dev/null
30 6 * * * /root/automysqlbackup.sh 2>&1 >> /dev/null

The first runs on the hour, 20 past and 20 to every hour, every hour,day,month,week