Running perl with CRON

Status
Not open for further replies.

redxdev

New Member
Messages
1
Reaction score
0
Points
0
Hi, I am not too familiar with CRON, but I need to run a pearl script with it every 30 minutes. I have the timing set up, but I have a few other questions:

1. Should I run 'perl /dir/script.pl' or '/dir/script.pl' or something else?
2. Should I be setting the directory to something like '/home/redxdev/dir/script.pl' or '/dir/script/pl'?

I think what I'm generally asking is what should the command be?
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
1. Should I run 'perl /dir/script.pl' or '/dir/script.pl' or something else?
2. Should I be setting the directory to something like '/home/redxdev/dir/script.pl' or '/dir/script/pl'?

I think what I'm generally asking is what should the command be?

`/usr/bin/perl /home/redxdev/dir/script.pl` should work. If you set executable permissions on the file (e.g. 711) and start the file with a shebang line, you can also use `/home/redxdev/dir/script.pl` as the command line. Any reference to '/dir/script.pl' won't work because there's nothing at that pathname and cron doesn't use chroot.

If you're developing on a MS platform, make sure you FTP the file in ASCII mode so it uses Unix line endings. I also recommend trying to run the script as as CGI script (which will probably require tweaking it) to check that it works on X10.
 
Status
Not open for further replies.
Top