|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
in /etc/crontab, but not running
I wanted to run a perl script at one minute intervals so I added the appropriate line to /etc/crontab. It isn't being run. Is there anything else I need to do to make it work?
Thanks! |
|
#2
|
||||
|
||||
|
have you tried running
crontab -e you can then edit the crontab file in vi (or your default editor), save it and close it, then you're away. if you exit crontabs manually, you must always then run the crontab command against that file. I'm not familiar with your setup. I'm used to seeing crontab files in /var/spool/cron/crontabs/ try the -e thing and if that doesn't work post back with your crontab entry. There are other things we could try. christo
__________________
. Spiration channels: Free scripts, programming tutorials and articles Dotcut alerts: Online Press cuttings / news alerts Clearprop: UK microlight school, wiltshire Uk dating: UK safe dating with Topdates About Christo . . |
|
#3
|
|||
|
|||
|
I went ahead and made a file, cron.txt, with these contents:
* * * * * /usr/local/vhosts/affiliatefreebies.com/cgi-bin/oxmx_task.pl >/home/cronoutput.txt Then I entered 'crontab cron.txt' and now when I do 'crontab -l' I get: # DO NOT EDIT THIS FILE - edit the master and reinstall. # (cron.txt installed on Thu Jun 12 21:36:25 2003) # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $) * * * * * /usr/local/vhosts/affiliatefreebies.com/cgi-bin/oxmx_task.pl >/home/cronoutput.txt Now it runs every minute. Last edited by scream : June 12th, 2003 at 11:46 PM. |
|
#4
|
|||
|
|||
|
I am seeing a problem though with the output in that cronoutput.txt file. The perl script I am running references objects like Something::Else and also uses relative paths. I do not think cron is running the script like it's in the directory it is actually in though, because it generates errors. However, when I just 'cd' into the directory and run the script, it works fine.
Any ideas on that problem? |
|
#5
|
||||
|
||||
|
edit your crontab line to say:
* * * * * /usr/local/vhosts/affiliatefreebies.com/cgi-bin/oxmx_task.pl >/home/cronoutput.txt 2>~/errorfile.txt any cron errors will then be added to the errorfile.txt in your home area. However, it sounds more like your PERL sript is being bad - and I can't comment on that without seeing (at least par of) it christo |
|
#6
|
|||
|
|||
|
I forget exactly what it said, but I read something last night that explained how when cron runs a script, it runs it as if it was being run from the same directory the cron program is in. That means any relative type paths you have in a Perl script will cause it to not work. I modified the Perl script and now it runs from any directory.
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Linux Help > in /etc/crontab, but not running |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|