Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Perl Script Not Working With Crontab

by pinetree (Scribe)
on Aug 24, 2007 at 22:05 UTC ( [id://634978]=note: print w/replies, xml ) Need Help??


in reply to Perl Script Not Working With Crontab

Edward, As a couple of comments have already pointed out, you do not necessarily have your expected environment set when your cron job runs. The solution is to fully path your commands and files. So, make sure you know where your commands are:
MBPro:~ oren$ which echo /bin/echo MBPro:~ oren$ which nohup /usr/bin/nohup
and update your script (change your locations as needed)
#!/usr/local/bin/perl -w use strict; system("/bin/echo test > /home/monkfan/testcron.txt"); #system("/usr/bin/nohup perl /home/monkfan/later_other_code.pl&");

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://634978]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-24 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found