Thanks,
Mark
On Apr 27, 2004, at 11:23 PM, Mark Wheeler wrote:
Well, it looks like it was the line endings. They were mac, I changed them to Unix, chmod the hello world script to 755, and the basic Hello world script fired off great. Next step is to read the file and print it's contents to an email.
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