1829010 Members
2327 Online
109986 Solutions
New Discussion

cron jobs issue

 
Pando
Regular Advisor

cron jobs issue

dear gurus,

a user complaits that a cronjob is missing.
is there a possibility to recover cronjobs made by users?

thanks!
3 REPLIES 3
Victor Semaska_3
Esteemed Contributor

Re: cron jobs issue

Do you have backups of /var? A user's crontab entries are kept in /var/spool/cron/crontabs/ in a file with the username as the filename.

Vic
There are 10 kinds of people, one that understands binary and one that doesn't.
Ivan Ferreira
Honored Contributor

Re: cron jobs issue

You have to restore from a backup the user file in /var/spool/cron/crontabs.

Instruct also to your users to save their cron files using:

crontab -l > cron.backup

Then, if it's missed for some reason, just restore it using:

crontab cron.backup
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Geert Van Pamel
Regular Advisor

Re: cron jobs issue

An even better solution is to use RCS (Revision Control System) to keep an archive of the cron.backup file.

The advantage in a production environment is that you can register all historical changes. If user complaints come later then you know who changed what/when/why.

The same goes of course for your shell scripts.