Find the answer to your Linux question:
Results 1 to 4 of 4
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2007
    Posts
    7

    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;

  2. #2
    Linux User peteh's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    340
    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.
    Pete

  3. #3
    Just Joined!
    Join Date
    Dec 2007
    Posts
    7
    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

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User peteh's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    340
    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.
    Pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •