john Asked: 2011-04-12 13:37:45 +0800 CST2011-04-12 13:37:45 +0800 CST 2011-04-12 13:37:45 +0800 CST How to run cron job on a specific hour every day? 772 What do I need to write in crontab to execute a script at 3pm every day? linux cron 2 Answers Voted Best Answer calman 2011-04-12T13:54:33+08:002011-04-12T13:54:33+08:00 You are looking for something like this (via crontab -e): 0 15 * * * your.command.goes.here 15 is the hour and 0 is the minute that the script is run. Day of month, month, and day of week get wildcards so that the script gets run daily. entropo 2011-04-12T14:44:21+08:002011-04-12T14:44:21+08:00 Here's a header that's good to put on top of your crontab for easy reference: # +--------- Minute (0-59) | Output Dumper: >/dev/null 2>&1 # | +------- Hour (0-23) | Multiple Values Use Commas: 3,12,47 # | | +----- Day Of Month (1-31) | Do every X intervals: */X -> Example: */15 * * * * Is every 15 minutes # | | | +--- Month (1 -12) | Aliases: @reboot -> Run once at startup; @hourly -> 0 * * * *; # | | | | +- Day Of Week (0-6) (Sunday = 0) | @daily -> 0 0 * * *; @weekly -> 0 0 * * 0; @monthly ->0 0 1 * *; # | | | | | | @yearly -> 0 0 1 1 *;
You are looking for something like this (via crontab -e):
15 is the hour and 0 is the minute that the script is run. Day of month, month, and day of week get wildcards so that the script gets run daily.
Here's a header that's good to put on top of your crontab for easy reference: