0

I have scheduled a cron job (which runs a php script) which runs every 15 minutes. This cron job is in dependence of another separate system and code and one day this system crashed so after the weekend I found the server flooded with numerous scheduled jobs.

Can you give me some advice how to avoid such problems? Maybe, to clean similar old cron jobs automatically or something else?

Thank you!

4
  • You could set a timeout for the commands, so that they stop after a certain period of time.
    – Jerodev
    Feb 16, 2017 at 14:25
  • You mean in my php script - sometling like sleep? Or on the server? My cron now is just */15 * * * * path-to-file-to-run
    – Dimentica
    Feb 16, 2017 at 14:37
  • 1
    I mean a maximum execution time. As described in this question: stackoverflow.com/a/10225072/743016.
    – Jerodev
    Feb 16, 2017 at 15:12
  • Yes,this seems really useful, I will try it, thank you!
    – Dimentica
    Feb 17, 2017 at 14:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.