Posts Tagged ‘Hour’

Linux:Simple cron/crontab daemon usage run/execute/schedule script/program every 5 10 15 minutes

Monday, June 30th, 2008

crontab -u root -e
Edit current job list for root user.
crontab -u root -l - lists the crontab job list for the root user.
crontab -u root -r - removes the crontab job list for the root user.
crontab run script every 5 minutes
# min  hour day/month   month   day/week
*/5 * * * * /root/script.pl
crontab run script every 10 minutes
# min  hour day/month   month   day/week
*/10 * * * * /root/script.pl
crontab run script every 15 minutes
# min  hour day/month   month   day/week
*/15 * * * * /root/script.pl
# run fifteen minutes after midnight, every day
15 0 * * * /root/script.pl
a crontab entry fields are:
1. Minute - Minutes after the hour (0-59).
2. Hour - 24-hour format (0-23).
3. Day - Day of the month (1-31).
4. Month - Month of the year (1-12).
5. Weekday - Day of the week. (0-6, where 0 indicates Sunday).