Scheduled periodical jobs: cron

To schedule jobs to execute repetitively at regular intervals, use cron. Daemon crond runs every minute and searches /var/spool/cron for crontab files and also searches for /etc/crontab.
/etc/crontab:
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user  command
17 *    * * *   root    run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily
47 6    * * 0   root    test -x /usr/sbin/anacron || run-parts --report /etc/cron.weekly
52 6    1 * *   root    test -x /usr/sbin/anacron || run-parts --report /etc/cron.monthly
 
Format: (time) (user) (executable)
time: minute (0-59), hour(0-23), day of the month(1-31), month(1-12), week day (0-6) starting with Sun.
Example:
25 10 * * * root  /root/scheduled.sh   # runs /root/scheduled.sh every day at 10:25
25 10 * * 6 root  /root/scheduled.sh   # runs every Sat. at 10:25
*/5 * * * 6 root  /root/scheduled.sh   # runs every 5 min on Sat.

Previous Pageprevious First Pagetop Next Pagenext