How to executing cron one minute after midnight every day? How to executing cron one minute after midnight every day? unix unix

How to executing cron one minute after midnight every day?


Yes the cron time is correct.

1 0 * * * /mydir/myscript 

should be your cron entry.

Each cron entry consists of six fields, in the following order:

minute(s) hour(s) day(s) month(s) weekday(s) command(s) 0-59      0-23    1-31    1-12     0-6


1 0 * * * /mydir/myscript <-- Correct 1 minute after midnight

1 0 * * * * <--- Incorrect, Syntax Error


Let's get the definitions straight: cron is a daemon that is designed to run continuously and execute commands at specified intervals when you tell it to.

To do that, it needs two things: an interval and a command.

Your example has a valid interval, but is missing a command to execute one minute after midnight:

1 0 * * * * /path/to/executable/or/script/here