Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

What do I need to write in crontab to execute a script at 3pm every day?

share|improve this question

2 Answers 2

up vote 13 down vote accepted

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.

share|improve this answer
2  
For any other specifics, googling "cron syntax" gives adminschoice.com/crontab-quick-reference as the first link... for a list of specific directories and configuration files that cron reads you can also check man cron –  photoionized Apr 11 '11 at 22:08

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 *;
share|improve this answer
    
Thank you very much, totally useful! –  john Apr 12 '11 at 18:19
1  
Glad to have helped. :) –  entropo Apr 12 '11 at 18:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.