Hi, I am using TOS DI to write a DI Job that will be executed once per hour via cronjob. Sometimes it will happen that a Job will not finish executing within one hour - so cron will trigger the job even though the one from the previous hour is still running. How can I make sure that in this case, the new job is NOT executed? Thanks Matt
Put a mechanism at the beginning of the job to check for the presence of a file or to check a database column for a value. If the file or value are there, then do not proceed with running. If they are not, then add the file or column value and continue running the job. At the end of the job delete the file or remove the database value.
You could make a new script that will check to see if the job is running, if the job is running the script can sleep or exit, otherwise make the script launch your job. Have the new script run in cron and turn off calling the job directly. In your script use the ps aux to see what is running currently. Use grep and the job name to see if the job is running. ps aux | grep jobNameHere