Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Jan 2000 22:25:42 -0500 (EST)
From:      "Crist J. Clark" <cjc@cc942873-a.ewndsr1.nj.home.com>
To:        osiris2002@yahoo.com (Joss Roots)
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: HELP: cron & /etc/periodic question.
Message-ID:  <200001040325.WAA11551@cc942873-a.ewndsr1.nj.home.com>
In-Reply-To: <20000103210817.12790.qmail@web125.yahoomail.com> from Joss Roots at "Jan 3, 2000 01:08:17 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Joss Roots wrote,
> Hi there,
> I am running LATEST 3.4- as of yesterday.
> I added a small script:
> 
> /etc/periodic/daily/500.systemupdate
> owned by root:wheel
> I set its permissions to be -rwxr-xr-x

Check.

> this script runs 2 simple scripts from
> /root/scripts
> both are excutable

Check.

> #!/bin/sh -
> /root/scripts/sysupdate
> /root/scripts/portsget

For debugging purposes, why not change this to,

#!/bin/sh -

echo ""
echo "Running sysupdate:"

/root/scripts/sysupdate

echo ""
echo "Running portsget:"

/root/scripts/portsget

#End

This way, you can see if the file is being executed at all.


> I have the default /etc/crontab
> which runs periodic daily among other stuff

Check.

> cron can't seem to run the scripts
> /etc/periodic/daily/500.systemupdate
> for some reason.

Put the above in for some debugging output. If you still have
problems, please show us the 'daily' mail with those echos, and the
'ls -l' of both /etc/periodic/daily and /root/scripts.

> anything else I have to do to add local
> or custom crontab jobs like this ?

Nope. You should just have to drop a file with the format, 

 ###.filename

In that directory and set executable for root. To see what is actually
done, look at /usr/sbin/periodic; it's a sh script.

> I did a killall -HUP crontab
> and nothing.

This step is not needed and will do nothing for this problem.

But as an aside, might I venture to guess that those two scripts do a
CVSup of the ports tree and /usr/src/sys tree? There is an easier way
to do that. Edit the "SUP*" variables in /etc/make.conf appropriately
and then just add something like the following to /etc/crontab,

# CVSup source code and ports daily
0       4       *       *       *       root    cd /usr/src; make update > /var/log/cvsup.log 2>&1

Again, no SIGHUPs to cron are needed for changes to /etc/crontab or
use of crontab(1).
-- 
Crist J. Clark                           cjclark@home.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200001040325.WAA11551>