Re: FW: Crontab problems

"Steven W. Orr" <[email protected]>
Newsgroups gmane.linux.redhat.release.guinness
Message-ID <[email protected]>
On Thu, 19 Sep 2002, Taylor, ForrestX wrote:

=>Tom Gillon wrote:
=>> Hi, thanks for the quick reply.
=>> 
=>> Here's the crontab entry:
=>> 
=>> 0 2 * * * /home/webct/webct_backup
=>> 
=>> Here's the contents of the webct_backup file that crontab is calling:
=>> 
=>> cd /home/webct/webct/webct/generic/admin
=>> perl admin.pl batch `ls ../../courses/`
=>> 
=>> I don't get an error, it just doesn't complete the backup when run from
=>> crontab.  It starts the backup process, but ends very early during the
=>> process.  However, when run from the command line, the admin.pl script
=>> works fine.  This worked fine in Red Hat 6.2, but since I upgrade to 7.0
=>> (new hard drive, fresh install), it doesn't work.
=>> 
=>> Perhaps there is something in the webct_backup file that is not allowed
=>> by the cron process?
=>
=>You could do a couple of things to get more information about what is 
=>going wrong.  Change your crontab entry to something like this:
=>
=>0 2 * * * /home/webct/webct_backup &> /home/webct/webct_backup.log
=>
=>and edit /home/webct/webct_backup, and create/change the first line to 
=>something like this:
=>
=>#!/bin/bash -x
=>
=>That should allow you to see where it is failing.
=>
=>Forrest
This will unfortunately not be of any help. You would only be tracing a 2 
line shell file. This won't help you with your perl code. 

Instead, run your job iteratively using the batch commmand. It provides 
the exact same environment as cron. Also, add an env commmand so you can 
compare what the difference is between what works from the console vs. 
what doesn't work from cron. Also, be advised that cron does not have 
access to a terminal, so if your job is presuming access to one, that 
could be (part of) your problem.

-- 
-Time flies like the wind. Fruit flies like a banana. Stranger things have -
-happened but none stranger than this. Does your driver's license say Organ
-Donor?Black holes are where God divided by zero. Listen to me! We are all-
-individuals! What if this weren't a hypothetical question? [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.