crontab

TorgoX on 2002-07-16T09:13:55

Dear Log,

Two lines that belong in every crontab file:

MAILTO=your_email_address_here
1 1 1 * * /bin/csh -c 'crontab -l | mail -s crontab $MAILTO'

And if you're really ambitious:

1 1 1* * /bin/csh -c 'crontab -l | crontab2english | mail -s crontab $MAILTO'


Why?

jjohn on 2002-07-16T12:08:47

Why do you want to mail your crontab to yourself monthly? Hell, my mail client filters cron mail to the trash now.

Re:Why?

TorgoX on 2002-07-16T13:54:15

Well, long story short: I have backups of accounts, but I never know where I put them. (Usually in a "very safe place", wherever that is.) However, I /always/ have all my mail files at hand, going back at least a year. When a machine dies or is "replaced", often the crontabs aren't restored right; so I'm always happy I can just pull out the crontab from my mail file.

I put things in a crontab file (on various machines) so I can forget about those things. So if the crontab file gets lost, if not for my backup, I'd go batty wondering what I'd lost.