I have Ubuntu Server 8.04LTS (Hardy Heron). I have several perl scripts that I need to automatically run daily, each script needs to run a on different hour and their are a total of 24 scripts. THey are all located in /var/www/cgi-bin/ All of the scripts work print to a .txt if i manually run them. I created a crontab called auto which is in the same directory as all the other files. when I type crontab -l this is what is shows me
0 0 * * * 0.pl
0 1 * * * 1.pl
0 2 * * * 2.pl
0 3 * * * 3.pl
0 4 * * * 4.pl
0 5 * * * 5.pl
0 6 * * * 6.pl
0 7 * * * 7.pl
0 8 * * * 8.pl
0 9 * * * 9.pl
0 10 * * * 10.pl
0 11 * * * 11.pl
0 12 * * * 12.pl
0 13 * * * 13.pl
0 14 * * * 14.pl
0 15 * * * 15.pl
0 16 * * * 16.pl
0 17 * * * 17.pl
0 18 * * * 18.pl
0 19 * * * 19.pl
0 20 * * * 20.pl
0 21 * * * 21.pl
0 22 * * * 22.pl
0 23 * * * 23.pl
so i believe that means that they are registered with the cron stuff.
anyone have any ideas on what the problem might be?
Is /var/www/cgi-bin/ in your path? If not, add a path statment at the top of the crontab file (PATH= add this to the end of your path :/var/www/cgi-bin/ ).
If that doesn't work you might want to post one of the pl files.
Last edited by drs305; May 24th, 2008 at 10:52 PM.
ok i changed all of the paths and now they all look like this
0 0 * * * /var/www/cgi-bin/0.pl
also here is the perl script that it needs to run, i do knwo for sure that teh script works
my $url = 'http://en19.tribalwars.net/map/tribe.txt';
my $content = get $url;
print W "@array[$n] @array[$j]\n";
I don't use perl but I am pretty sure you need to designate the path to perl at the beginning of the file. If you do a search for crontab and perl you can probably find an answer if no one comes to your assistance here.
do you mean like #!/usr/bin/perl ??
do you mean #!usr/lib/perl?
That's right. - without the ? though
Originally Posted by frenchface
i added that to all the scripts i'll see if it stars to work
First line should look like this:
And also. Sorry if this sounds odd...
But are all the scripts identical?
If so, why not just have one script put inside the "/etc/cron.hourly" folder? (Or at the very least have one script that is ran hourly).
Last edited by ibuclaw; May 24th, 2008 at 11:44 PM.
no they are not identically. otherwise that would have made it alot easier
Tags for this Thread