3

I have stuggled on a few occassions to get crontab to work where job B depends on job A having completed sucessfully.

The last time I had to use crontab for enforcing depencies we had to simulate success at the process level. That meant that job A would output a 'success' or a 'done' file once completed. Job B would then check the existence of this success / done file before starting.

Unfortunately that meant that

  1. Processes all had to have this startup code (Yes I know it could be reused by including in a jar file / DLL)
  2. the file system was littered with success / done files which would have to be cleaned up at the end of the day

I have used Autosys in the past which handles dependences more gracefully but the enviroment I am in at the moment means that Autosys is harder to use / maintain / introduce.

What are peoples approaches to enforcing job dependencies when using crontab?

Jack Kada
  • 24,474
  • 29
  • 82
  • 106
  • 3
    `cron` does not care about dependencies at all. It simply has a list of jobs to run at specific times. If you must use `cron`, then write a short master shell script that runs the other scripts in the proper order, observing whatever dependencies need to be satisfied, and use `cron` only to run the master script. Or, use a different non-`cron` tool that's designed for the job... – twalberg Jan 05 '15 at 15:37

0 Answers0