Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jun 2012 02:38:32 +0000 (UTC)
From:      Walter Hurry <walterhurry@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Newbie question: Why aren't my cron jobs running?
Message-ID:  <jrbir8$mmq$1@dough.gmane.org>
References:  <201206120506.q5C56L2H026673@mail.r-bonomi.com> <op.wfsk2or734t2sn@tech304> <20120612190629.6a45cb11.freebsd@edvax.de> <CAPW8bZ1fFB8S0=kRpJ=X7w-Da=W4hjuXFHHTuZMc_Ac5FyTs3Q@mail.gmail.com> <jrb7ck$fut$1@dough.gmane.org> <4FD92D52.50603@makeworld.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 13 Jun 2012 19:16:18 -0500, Chris wrote:

> On 6/13/2012 6:23 PM, Walter Hurry wrote:
>> On Tue, 12 Jun 2012 12:21:31 -0500, Dan Lists wrote:
>> 
>>> The syntax of his crontab file is correct.  Vixie cron does care about
>>> leading spaces, tabs, extra spaces, or leading zeros.  Earlier
>>> versions of cron are much pickier about the crontab file.   The cron
>>> logs show that it is starting his jobs at the correct times.
>>>
>>> It is far more likely that there is a problem with the scripts.  A
>>> very common cause of problems with scripts run from cron is that they
>>> do not inherit your environment.   Do the scripts run from the command
>>> line? If the do, then the problem is most likely something in your
>>> environment that the scripts need.
>> 
>> I'm a complete idiot, and I feel embarrassed. Everything was fine,
>> except that I had missed out '/bin' in the paths of the jobs.
>> 
>> I had:
>> /home/walterh/exports.sh /home/walterh/backup_etc.sh
>> /home/walterh/systemcheck.sh /home/walterh/backup_bsd.sh
>> 
>> which should of course have been:
>> /home/walterh/bin/exports.sh /home/walterh/bin/backup_etc.sh
>> /home/walterh/bin/systemcheck.sh /home/walterh/bin/backup_bsd.sh
>> 
>> What a stupid mistake! Thanks for all the replies, but I must say sorry
>> for wasting your time. Sorry!
>> 
>> WH
> 
> ... Damned those full path names.

Actually, given that PATH i specified in the crontab, I don't think the 
full pathnames are needed. I'll try that next.

When I finally have this cracked, I can add the rest of the cron jobs.

$ crontab -l
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/
walterh/bin
HOME=/home/walterh
PGHOST=jupiter
#min hr dom month dow command
 00  02 *   *     *   /home/walterh/bin/exports.sh
 05  02 *   *     *   /home/walterh/bin/backup_etc.sh
 10  02 *   *     *   /home/walterh/bin/systemcheck.sh
 15  02 *   *     *   /home/walterh/bin/backup_bsd.sh
$




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?jrbir8$mmq$1>