Test a weekly cron job

dynamic picture dynamic · Feb 13, 2011 · Viewed 283.2k times · Source

I have a #!/bin/bash file in cron.week directory.

Is there a way to test if it works? Can't wait 1 week

I am on Debian 6 with root

Answer

NNRooth picture NNRooth · Sep 18, 2013

Just do what cron does, run the following as root:

run-parts -v /etc/cron.weekly

... or the next one if you receive the "Not a directory: -v" error:

run-parts /etc/cron.weekly -v

Option -v prints the script names before they are run.