Run a cron job only of the output of the previous job is removed

Avatar
  • Answered
How do i set a cron job to post a file only when the previous file has been changed/renamed to avoid the file being over written?
Avatar
Scott
Hello,

Thank you for your question on running a conditional cron job. A cron job is only a timed script. The fact that it is a cron has no bearing on the script itself. This means that the script will need to be written to check for the previous file and if it is still there, it will not run.

Technically the cron will still run, but the script will decide whether or not to create a new file or not.

Kindest Regards,
Scott M