OK... I got the "foo" in my mailbox, so cron is working. So I'll go with the next step of a basic perl script.

Mark


On Apr 27, 2004, at 8:23 PM, Ken Williams wrote:



On Apr 27, 2004, at 5:07 PM, Mark Wheeler wrote:


Yup. You're right. I missed that one. Here's what I did to simplify the testing of the script.
--------------------------------------------
#!/usr/bin/perl -w


use strict;
use File::Copy;

copy("/Users/xxxxxx/Documents/db1.txt", "/Users/xxxxxx/Documents/db1.txt.bak") or warn "Can't copy file: $!";

print "Backup Completed.";

exit;
---------------------------------------------
I know the cron is firing off the request, because when first tried it, I got Permission Denied in my email box. So I changed the permission to 755 and it still doesn't copy the file. And I get nothing in my email box. I'm a little confused. What am I missing?

First rule when it looks like a script isn't doing anything on OS X: check the line endings. Make sure they're unix-style. If they're Mac-Classic style, running the script won't actually do anything.


First rule when setting up cron jobs: make sure cron itself is running. Set up a job with the same timings as the script in question, but make its action "echo foo" or something like that. You should get an email when it runs. If not, then cron's the problem, not perl. I know you said it worked before, but just to make sure...

-Ken




Reply via email to