I wrap the perl script in a .cmd file (this allows you to control precisely what the environment looks like when the script hits the road), and also save the output:
c:
cd \backup
echo run backup.pl >backup.out
perl backup.pl >>backup.out 2>backup.err
And then you can check the timestamps of backup.out and backup.err to ensure that the script was actually run and not merely that the scheduler ignored it (or the scheduler service was stopped -- this happens too).
Since you're redirecting STDOUT, feel free to go crazy with print traces. It'll help you track down what went wrong.
Depending on your infrastructure, you might want to drop a use Win32::EventLog::Carp at the top of the program, and then any warn or die messages will be logged in the Event Viewer.
• another intruder with the mooring in the heart of the Perl
|