Crontab Fun

I have a crontab behind the scenes on this site which does all sorts of things. It automatically changes the graphics on certain dates, it rebuilds the site when I've set something to 'futurepost', it grabs links from and massages them into a form where they can be included on this site. For the uninitiated, a crontab is a scheduler (winxp has a similar thing buried in the control panels).

It allows you to specify that certain tasks run at certain times.

To edit the crontab, one types crontab -e

To list it, one types crontab -l

To remove it, one types crontab -r

Note that e and r are neighbours on the keyboard. Can you guess what I did this morning? Can you?

Of course, being on Linux there was no 'are you sure?' - 'are you really, really sure?' - 'Okay, if you insist, but I'll keep a copy in the trash for you'. No, none of that. It was GONE.

Disaster, especially as I'd spent a deal of time (as some helpful people will testify) putting all sorts of cleverness in there.

Fortunately, I am in the habit of typing crontab -l prior to any editing, and was able to reconstruct it (I hope I got it all!)

I now have a new line in my crontab: 0 19 * * * crontab -l > ~/backup.cron/cronbackup

This takes the output of crontab -l and writes it to a file once a day.

Why didn't I do that before? Always the way with backups.....