help with 'cron'

Madison Kelly linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org
Thu Apr 14 17:08:35 UTC 2005


Hi all,

   I am going slightly mad here trying to get 'cron' working. I've read 
a fair bit on cron, I am more or less sure I've got the syntax right, 
but it just won't run. I've even looked at working crontab files...

   I am trying to run a perl script (eventually) and a bash script (for 
testing). At this point I have a very simple perl script that reads what 
command line switches it was passed and prints it out. When it tries to 
run it though I get an invalid terminal error. So I decided to try 
calling it through a shell script with 'export TERM=xterm' and that 
worked a couple of times but now it doesn't.

   I've tried having cron email me but it doesn't want to do that, 
either. I have even tried redirecting the scipt output to a file just to 
see if it's running but nothing there, either.

   All I want to do is have cron call a perl script with certain 
switches at a given time... As I understand this is what cron should be 
really good at. So I've created this file:

-=-=-
[madison at akane cgi-bin]$ cat data/cron
SHELL=/bin/bash
PATH=/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin
MAILTO=linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org

30 23 * * * /usr/share/tle-bu/cgi-bin/backup.pl --id=4 -y
-=-=-

   The actual script called I've changed between the perl script and the 
shell script while testing. Ideally I'd like to just call the perl 
script without the hassle of an intermediary shell script but to set the 
terminal.

   Here is the output after I load it:

-=-=-
[madison at akane cgi-bin]$ crontab -r && crontab data/cron && crontab -l
SHELL=/bin/bash
PATH=/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin
MAILTO=linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org

30 23 * * * /usr/share/tle-bu/cgi-bin/backup.pl --id=4 -y
-=-=-

   Now for testing I've set the time to '* * * * *' so that it should 
run every minute but that doesn't seem to make any difference as it 
never seems to run anyway.

   This is on FC3 running 'vixie-cron-4.1-24_FC3'. Is anyone here good 
at cron and able to give me some insight as to what is wrong or maybe 
even just some tips on better testing or debugging techniques? Ideally 
is there any way to tell cron to run manually (rather than waiting for 
the given time) to make it easier to test?

   Thanks all!

Madison

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Madison Kelly (Digimer)
TLE-BU, The Linux Experience; Back Up
http://tle-bu.thelinuxexperience.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list