2

I am trying to set a cron job in the crontab which would execute my command every day at specific minute of specific hour. I am using the Indian timezone in my server.

If I set the job like below, well ... it executes at specific minute in every hour:

30 * * * * COMMAND

But if I set the job like below, it doesn't execute:

30 15 * * * COMMAND  # not excecuting

Why it is not executing? Where is the problem?

3
  • Given the CRON job starting at 2016-02-18 13:50:05 (now), it would run: 2016-02-18 15:30:00, 2016-02-19 15:30:00, 2016-02-20 15:30:00... Feb 18, 2016 at 12:51
  • Check the logs for more detail /var/log/syslog grep CRON /var/log/syslog Feb 18, 2016 at 12:53
  • @RameshChand You need a | in there somewhere I think. Also that doesn't run.
    – Tim
    Feb 18, 2016 at 12:57

2 Answers 2

1

You can add a cron job like:

30 00,01,02,....23 * * * COMMAND

where you can specify your desired hours as 00,01,02,...23 (separating them with a comma).

0

For anyone with similar problem.

The syntax of cron definition is correct.

The problem could be with timezone. If you changed the timezone of your server, and didn't restart the cron service, maybe this is the problem.

Just execute: sudo service cron restart, and maybe it could work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .