[dundee] Cron - scared yet?

Andrew Clayton andrew at digital-domain.net
Wed May 23 22:02:48 BST 2007


On Thu, 24 May 2007 04:08:38 +0800, Nistur Effee wrote:

> Oops, I believe I just sent a blank email. I should really sleep
> sometime soon. Apologies everyone
> Anyway, I was wondering, what is everyone's opinion on Cron? I have
> always considered automating certain parts of my system, sit down,
> read a guide and then get distracted. Is it really as scary as it
> looks? Or is it as straight forward as you would hope? Secondly, I

It looks scary!? hmm, in either case it's really quite straight forward
to use.

> was wondering something, I have a NAS enclosure now, but I'm not
> going to assume that anyone else on the network is going to scan it.
> I therefore set up ClamAV but it's going to be a pain in the neck to
> do it manually all the time. All I was wondering was whether anyone
> knew, assuming I set up crond to do something daily, say at 4AM... if
> my laptop was off at that point, would it do it next time it was
> booted?

This is really simple (maybe depending on your version of cron) 

On Red Hat/Fedora based systems all you'd simply do is create a shell
script (doesn't have to be shell or even a script) in /etc/cron.daily/
to do whatever you need it to do and this will get run I think around
4am daily. (remember to make it executable, this may be important)

Otherwise you can create a more normal cron entry in /etc/cron.d/ like

e.g

# cat > /etc/cron.d/clamav
0 4 * * * root /usr/sbin/clamav /somedir
^d

Which will run /usr/sbin/clamav /somedir as root at 4 am daily.

Or you can do a contab -e and stick it in your user contab (missing out
the username).

No need to restart cron or anything, it automagically picks up changes
every minute.

> I'm going to have to brush up on my scripting to get this to work
> methinks. I see a lot of... fiddling approaching.
> 
> Thanks in advance
> 
> ---------------------------------------------------
> Signing out
> Nistur                            nistur at karate.com
> 

Andrew



More information about the dundee mailing list