[wellylug] crontab file
Ewen McNeill
wellylug at ewen.mcneill.gen.nz
Tue Sep 28 12:25:15 NZST 2004
In message <20040927220921.FEVM56.mta1-rme.xtra.co.nz at there>, "E.Chalaron" writes:
>Ok I think I have it.
>There is in /etc/cron/ a file crontab that is obviouly the trouble maker
>since it reports the old time. Now editing crontab -e gives me the new time
I did wonder if that was what you'd done.
You've taken a copy of the system contrab (/etc/crontab) which contains
all the system jobs, and installed it (with a few modifiations) as the
root user crontab (as listed by crontab -l,
in /var/{lib,spool}/cron/{crontabs,tabs}/root -- alas the location
varies from OS to OS :-( ).
So now you have the system cronjobs running both from the system
crontab, and also from the root user crontab, and hence they're running
twice (apparently at different times).
>Can I get rid of this "old" crontab file in /etc/cron ?
I guess you could remove /etc/crontab, however IMHO that way lies madness.
(Eg, when you next upgrade cron on the system, the packages/make
files/whatever will probably install another copy of /etc/crontab, and
you'll have to fix it again. And if the locations of those change, or
more are added, you'll have to manually copy over the changes. And so on.)
What I would suggest you do is:
(a) edit /etc/crontab so that the system cronjobs run when you want them to
(b) delete the system cronjob entries out of the root user crontab (or
delete the whole crontab if that's the only thing in there)
Any half-reasonable Linux distribution will mark /etc/crontab as a
"config file" and prompt you before overwriting it on package upgrade
and/or give you an opportunity to merge changes to it, so that should be
fairly safe providing you're careful when you upgrade.
Incidentally some Linux distributions (eg, Debian) also have an
/etc/cron.d which is formatted like /etc/crontab, but split up into
individual files so that packages can install their own crontab entries
easily. This wasn't in the original Vixie cron; I think it's a vendor
patch.
Oh, and finally, Vixie cron wasn't the original cron; it's just a
commonly used implementation in the Open Source world. (cron dates back
to Early Unix (tm).) There are other open source cron implementations
around too (ISTR Gentoo offering me a choice of three of them when I last
installed it).
Ewen
More information about the wellylug
mailing list