Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 have the following two entries in my Crontab job that are set to start at 10:00am.

Job #1

0,20 10 * * 1-5 ./run_program_A

Job #2

0,20 10 * * 1-5 ./run_program_B

At 10:15, I checked my log file and only program B was run. It seemed that program A never got fired off.

If I set the start time for program A to be 10:30, it will be fired off. I am not very familiar with Crontab, so I hope you can shed some light on it. Do I have to ensure all my jobs are not set at the same time?

Thank you in advance.

share|improve this question

marked as duplicate by Iain May 28 '13 at 18:06

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.

cron certainly does not have such constraints. The problem lies somewhere else (for instance, a lock used by both programs).

share|improve this answer
Yah, after a bit more research, the problem is quite likely hidden somewhere else. Thanks for the answer. – Ryan Liang May 8 '09 at 14:36

A few random things that might help track down the issue:

  • check for a cron log in /var/log
  • make sure you're getting the mail from cron output somewhere (the owner of the cron file, likely), since that might have interesting clues
  • replace "./run_program_A" with 'echo ./run_program_A', just to see if it's getting kicked off at all
  • place "echo 'program A ran' | mailx -s program_A" inside the run_program_A to verify that it's running
share|improve this answer

No, you shouldn't have to avoid conflicts, cron should cope perfectly well with jobs that start at the same time, or otherwise overlap.

Is there any chance that both scripts are writing to the same log file, such that one script is over-writing the other script's output?

share|improve this answer
Thanks for the real quick answer. It shouldn't be the overwrite issue because both programs would create a record in the DB if they are run. The issue could lie in somewhere else. I will dig deeper then. – Ryan Liang May 8 '09 at 14:35

Check the /var/log/cron for error messages. There's surely something wrong with how's the "program_B" is called.

share|improve this answer

20 10 * * 1-5 ./run_program_A > run_program_A.log

check the log file after 10:20 as

ls -ltr run_program_A.log

if the file is generated at 10:20 the issue lies in script run_program_A and not in cron

for cron help

share|improve this answer

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