Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I'm having trouble running a cron job at particular times during the day.

Will this crontab setting run the command at 3am, 6am, noon, 6pm, and 9pm?

0 3,6,12,18,21 * * * command
share|improve this question

migrated from Nov 7 '11 at 15:36

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Iain, masegaloeh, MadHatter, fukawi2, mdpc Mar 3 '15 at 3:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 5 down vote accepted

If that is in a user crontab (edited with crontab -e or crontab -e -u username), then yes.

If that is in the system crontab (/etc/crontab), it needs a username, i.e.

0 3,6,12,18,21 * * * run-as-this-username command
share|improve this answer
the job already runs each hr. – MB34 Nov 7 '11 at 16:06

Your cron specification is correct. If it doesn't appear to be running, it may be a PATH problem (i.e., your script references something in /usr/local/bin). If that's the case, you can stick something like


etc., at the top of your crontab to set the PATH for the cron jobs. (You can do something like "echo $PATH" at the command line to see the current PATH).

share|improve this answer
path is not a problem – MB34 Nov 7 '11 at 16:08

Yes, afaik, this should work. Did you already try it?

share|improve this answer
no but it already runs using this: 0 * * * * command – MB34 Nov 7 '11 at 16:06

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