Does anyone know a script (bash, perl, php ...) to validate the syntax of crontab files?

I found this http://www.intuitive.com/wicked/showscript.cgi?053-verifycron.sh but just Vixie cron notation is not supported (eg, 2-6/2).

  • You definitely want to check a question of mine. It has an answer by Stephane Chazelas that explains how you can create an interactive shell that is identical to the environment your cron job will see. If you walk through his little procedure, you get a prompt and you can test your script step by step and see where it fails. unix.stackexchange.com/a/56503/16841 Sure it isn't a 100% match for your question, but it can help you troubleshoot crontab issues. – jippie Nov 23 '12 at 22:52
  • This depends on the cron implementation used. – Kusalananda May 15 '18 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.