Quick way to test your Cron Jobs

If you create your cron jobs sometimes you would need to test them just to be sure they work properly. So you need to execute them one by one regardless of their schedule.

The magic of command line makes it easy for us to write a command  and do it. So here it is:

Cron config

How does it work…

I’ll explain all parts of this command one by one.

  • This part will list all cron jobs we have defined.
  • This part will remove comment lines (all lines beginning with  ‘#’).
  • This part will remove time/date settings. It will cut every string from start to the fifth position. e.g. for the command bellow it’ll remove “00 09-18 * * *00 09-18 * * * /home/john/bin/check-db
  • This part will execute all commands (one by one) we have defined in our cron list.
One Response
  1. September 1, 2015

Leave a Reply

Your email address will not be published. Required fields are marked *

WP-SpamFree by Pole Position Marketing

Share This