in reply to Re^2: Running a perl script automatically on Mac OS X 10.5
in thread Running a perl script automatically on Mac OS X 10.5
Hi, I don't know much about OS X, but some OS have additional security restrictions. E.g., your UID might need to be listed in /etc/cron.allow and not in /etc/cron.deny (ALL matches every user) to be eligible to execute cronjobs.
Usually cronjobs are executed under plain /bin/sh, so you might explicitly want to change that. Furthermore, I would not trust tilde expansion. It might work, but using $HOME/path/to/script.pl or even manually expanding ~/ might help here. Most cron systems allow to set SHELL and HOME in the cronjob file.
Perl should be in your $PATH, but expanding that to /usr/bin/perl - or wherever perl is installed on your system is more reliable and secure. If your script.pl accesses some non-standard environment variables (i.e., via %ENV) you might need to explicitly start your standard shell (see: /etc/passwd) or use a wrapper.
So, you might end up with:
23 13 * * * /usr/bin/perl -w /home/prince9/path/to/script.pl
where /home/prince9 is the output of echo ~ and /usr/bin/perl
is hopefully the output of type perl ...
have a look at e.g. /var/log/messages too...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Running a perl script automatically on Mac OS X 10.5
by Ninth Prince (Acolyte) on Sep 09, 2008 at 13:44 UTC | |
by Anonymous Monk on Sep 09, 2008 at 13:58 UTC | |
by Ninth Prince (Acolyte) on Sep 09, 2008 at 14:25 UTC | |
by Perlbotics (Archbishop) on Sep 09, 2008 at 19:05 UTC |