I've found that a daily snapshot of current crontabs (in /var/spool/cron/$USER on my linux machine) works fine. Either an automatic cvs check in, or just a tar.gz of modified crontabs. I don't necessarily need an archive of each minor edit made to a crontab during the day, but rolling
it back to "the way it worked yesterday" is oft requested.
Behind the scenes, crontab -e really just automates these two steps:
vi $DefaultCrontabFile; # use your $EDITOR to edit default file
crontab $DefaultCrontabFile; # install said file
-Blake
| [reply] [d/l] |
I prefer using CVS. If it is already set up, it is no
extra work to do things that way, and for that you get the
visibility of a change-log, plus automated emails of
changes. Using backup policies may work, but you have to
remember more about your system configuration and lose
visibility for essentially no savings in effort.
Then again I have to work with crontabs which multiple
developers have edit privileges on. When you see something
in there that doesn't belong, it is very nice to be able
to say, "Who did that?" and get an answer.
Plus we already use CVS for our source-code. And working
from system backups is a pain. With CVS any developer has
that visibility in the same way they track anything else,
without having to ask anyone for assistance. Without it
all recoveries have to go to the sysadmin with the first
question being, "Where do we keep the backups?" And then
once you know where you keep the backups, "Where does this
version of Unix keep its crontabs?" My sysadmin has more
important things to do than babysit me through what should
be a minor "oops". Rolling back something in a crontab
may be a common need, but it needn't be a common request.
An incidental benefit for some people is that using
revision control makes it easy to have multiple machines
have the same crontab.
And finally, revision control is more convenient. For
instance I am in the process of modifying some logic about
what happens where in the nightly processes we run. It
is very convenient that I can edit the crontab file as I
am also editing the code for the processes that will run,
and then check the associated changes into production
together. If I had to make my source-code changes and
then remember everything to change in production, then
I would be more likely to make mistakes as I take things
into production.
So while keeping backups is sufficient for a personal
machine, given the choice I strongly prefer to use
revision control. (And I would walk before working on a
code-base without any kind of revision control in a
shared environment. Revision control isn't very hard to
set up, and I don't consider it optional. One vote to
the first person who can figure out what famous project
I would criticize on this issue...)
| [reply] |