LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-22-2006, 01:55 PM   #1
abrumley
LQ Newbie
 
Registered: Oct 2004
Distribution: Redhat
Posts: 6

Rep: Reputation: 0
Recovering my deleted crontab on FC3


I'm posting into general because I'm hoping the solution is not fedora specific.

While I won't go into the brilliance of having a utility that has the "erase w/o warning" option (-r) right next to the commonly used "edit" option (-e) (neighboring keys on a keyboard) I fat finger'd and deleted my crontab for root. (as root entered `crontab -r`)

Looking at the documentation (man crontab), it looks like the cron file that is specific to a user is stored in "/var" which seems contrary to almost all other user-scoped software settings which are stored in the home directory.
I keep backups of my home directories, but according to what I've read, my root's cron file was not backed up. Am I correct here?

2nd question, did I just mess up all of my day-to-day and hour-to-hour tasks that came with my distro? If I remember correctly the file was pretty small, and may have only had one line or two of distro specific stuff. I can redo my additions without too much problems.

If so, can someone send me the orig lines that come with an FC3 install, or tell me where I can find/extract fresh root cron file?


Thanks for any help,
Alan

Last edited by abrumley; 07-22-2006 at 01:59 PM.
 
Old 07-22-2006, 03:50 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by abrumley
I'm posting into general because I'm hoping the solution is not fedora specific.

While I won't go into the brilliance of having a utility that has the "erase w/o warning" option (-r) right next to the commonly used "edit" option (-e) (neighboring keys on a keyboard) I fat finger'd and deleted my crontab for root. (as root entered `crontab -r`)
The cron shipped with slackware DOESN'T have that option ;}

Quote:
Originally Posted by abrumley
Looking at the documentation (man crontab), it looks like the cron file that is specific to a user is stored in "/var" which seems contrary to almost all other user-scoped software settings which are stored in the home directory.
I keep backups of my home directories, but according to what I've read, my root's cron file was not backed up. Am I correct here?
Nope, crontabs for all users live under /var/spool/cron/ for
pretty much every distro and commercial Unix I've ever come
across ....

Quote:
Originally Posted by abrumley
2nd question, did I just mess up all of my day-to-day and hour-to-hour tasks that came with my distro? If I remember correctly the file was pretty small, and may have only had one line or two of distro specific stuff. I can redo my additions without too much problems.
No, you didn't. Those jobs are defined in /etc/cron.hourly and
so forth ...


Quote:
Originally Posted by abrumley
If so, can someone send me the orig lines that come with an FC3 install, or tell me where I can find/extract fresh root cron file?


Thanks for any help,
Alan
Sorry, I wouldn't touch a RH product by choice, and am in
the blessed position of not having any RH related installs
at work at the moment ;}


Cheers,
Tink
 
Old 07-22-2006, 11:54 PM   #3
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Most distros separate the user-level crontabs (even root's) from the system-wide crontab and the cron.{hourly,daily,weekly,monthly} cron dirs. You should be fine if you are able to restore your own cron jobs.
 
Old 07-24-2006, 01:54 PM   #4
abrumley
LQ Newbie
 
Registered: Oct 2004
Distribution: Redhat
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks

Thanks for the answer and the breakdown on where cron stuff is stored.
 
Old 07-24-2006, 02:36 PM   #5
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by abrumley
If so, can someone send me the orig lines that come with an FC3 install, or tell me where I can find/extract fresh root cron file?
If cron logging is turned on, you may be able to reconstruct the crontab file you deleted manually. I would expect the log to be in /var/log/cron.log or something similar, if logging is turned on. Check /etc/syslog.conf for logging settings for the cron facility (file could be in a different location for Fedora). Cron logging is off by default on my Debian boxes ... don't know about Fedora however.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
recovering deleted files saipraveen Linux - Newbie 1 06-16-2005 11:00 AM
Recovering a deleted photo hongman Linux - Newbie 1 03-18-2005 12:46 PM
recovering deleted files hamish Linux - Newbie 2 10-04-2004 05:51 PM
Recovering Deleted Files Brian of Gep Linux - Newbie 1 03-02-2004 02:26 AM
Recovering deleted data Korff Linux - Software 13 06-23-2003 01:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration