-
seek for your kidness
Dear all;
i would appreciate if you find me work around on this. i accidentally over wrote my crontab file "default one" and lost all the scheduled tasks that were existing before. let me explain what exactly i did:
1- i create my own file using vi and add a task for pinging our main server. the file path was under /home/username/mycronjobs/
2- i applied crontab /home/username/mycronjobs/filename
3- i realized that i lost all the cronjobs (that by default was installed under /var/spool/cron/crontabs) that was set by my colleague. it seems like i over wrote the old cronjobs.
please; help me on this as i need those cron jobs again on my system
thanks;
-
Look in /var/spool/cron and see if your old file was backed up. It would be in the format "filename ~" or "filename.bak" or similar.
If not then you may have to set it up again. That shouldn't be too difficult if you know which tasks were set.
-
Thanks Peteh for your fast response. It had to re-write 20 lines again.i appreciate the importance of backing up anything before making silly changes
-
If you want to edit cronjobs in the future, use "crontab -e" in a console - never edit the cron file directly.
Crontab -e opens the file specifically to edit. You can add any lines and save & quit or just quit if you don't want to save the changes.