I have deleted crontab by mistake
Hi Guys,
I just made a big mistake. I was accessing my box externally (ssh) and accidentally deleted my crontab. I never used crontab before and issued the command "crontab -d" instead of "crontab -e" to edit and add my cronjob. I am pretty useless because I had no back up of my crontab of course :( First question, is there going to be any direct issue on my box because of the crontab being erased ? (I am assuming so but do not know what type of problems..) Lastly, would I be lucky enough so that there is a way to recover my crontab ? (having gone through Google and whatnote, I doubt it). Thank you for your help Guys, Kind Regards, |
Quote:
The direct issue will depend on the cronjob you erased. Quote:
Kind regards |
repo, thanks for your reply.
the incidence would be that none of the cronjobs that were there would be executed anymore as they are all gone --> OK, but would those cronjobs be similar to all slackware 13.1 install ? If yes, I could just ask someone with a slackware 13.1 install for all the cronjobs and recreate all of them. The point being is that i did not see the type of jobs that were in it so i have no clue the effects of those jobs not being executed. |
Depends, did you erased them as user or as root?
What is the output from Code:
crontab -l AFAIK crontab -d will only erase the contabs you created, not the system crontabs like cron-daily,cron-weekly... Kind regards |
Ops, it looks like the coffee didn't kick in yet... :)
crontab -d will delete the crontab of the user that ran it. Like repo said, the "system" crontabs (i.e. /etc/cron.daily, /etc/cron.weekly and etc.) should be "safe" even if you ran crontab -d as root. |
Quote:
|
Quote:
If the OP did crontab -d as root, best option is to reinstall dcron. Kind regards |
I did reinstall dcron but to no avail.
The dcron was still installed and I still have no scripts that run cron.daily/weekly/hourly/monthly.. I am in the process of installing a vm and will have look in it to see what can be done in that regards. Worst case scenarios, I will reinstall slack on my box. Kind Regards, |
Quote:
If you had a root crontab that had the original entries from an original install, just edit crontab as root and paste this into corntab. as root do: Code:
crontab -e Code:
# If you don't want the output of a cron job mailed to you, you have to direct |
udaman,
Thanks a lot for your help. The crontab you posted helped a lot. I created a VM and got the exact same content. I recreated all the cron jobs and all his back to normal. Thanks again guys for all your help. Much appreciated. Kind Regards, |
riganta,
I'm glad I could be of some help. Cheers! |
All times are GMT -5. The time now is 08:12 AM. |