1

I need to a crontab execute each 12 hours, so I have the following:

 0 */12 * * * . /X.sh

then Linux is installing new crontab. after that, I am waiting for 2 hours and still the cron job didn't start?!

When has it to start the job?

3

The crontab entry you've written is equivalent to

0 0-23/12 * * * . /X.sh

This requests execution on the hour between midnight and 11pm, using 12-hour steps — so cron will run the job every day at midnight and noon.

  • I need to see the result as soon as possible linux time now is 9:18am, then I need to start run at 10am, and then the second one will be 10+12= 22 or 21? – H.H Jun 2 '16 at 9:21
  • is it correct now? 0 10,22 * * * – H.H Jun 2 '16 at 9:22
  • 1
    Yes, 0 10,22 * * * will run the job at 10am and 10pm. – Stephen Kitt Jun 2 '16 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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