I made a mistake by issuing the crontab - r command and the crontab was removed. Now, when I type crontab -l it is showing no crontab for root.
Can anyone please help me to restore the crontab?
1 Answer
If you have no /var/log/syslog file, you can recover the commands (but not the timings) from the syslog file.
use:grep 'CRON' /var/log/syslog
you can then figure out the timings by looking at the date-stamps.
Credits: Recover cron jobs accidently removed with crontab -r
PS: To avoid such problems in the funture, try to add a cron to backup your crontab everyday.