0

This question already has an answer here:

I want to run a command everyday but I am not sure how to do it correctly with the cron task.

I understand this is the code I need to know:

* * * * * command to be executed
- - - - -
| | | | |
| | | | ----- Day of week (0 - 7) (Sunday=0 or 7)
| | | ------- Month (1 - 12)
| | --------- Day of month (1 - 31)
| ----------- Hour (0 - 23)
------------- Minute (0 - 59)

If I do this * * * * * this mean it runs every minute, right?

What about everyday, particularly each day at 1AM?

Is it this 0 0 * * * for running the command everyday?

marked as duplicate by muru, karel, Zanna, David Foerster, Pilot6 Jul 10 '17 at 14:46

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.

  • 3
  • 1
    0 0 * * * will run it every day - more specifically, it will run it at midnight (00:00)... ie. when minute is 0 and hour is 0. To run it at 1AM, you'd use 0 1 * * * (minute=0, hour=1 ie. 01:00) – Baard Kopperud Jul 9 '17 at 20:49
2

Try this.

0 1 * * * command > /dev/null 2>&1

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