The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
crontab rajan_ka1 Shell Programming and Scripting 10 03-21-2006 02:03 PM
SZ in crontab manikumar UNIX for Advanced & Expert Users 1 03-08-2006 07:31 PM
Messed up tar files Barb UNIX for Dummies Questions & Answers 2 11-03-2004 08:24 AM
ALERT!!! ALERT!!! I messed up the UNIX!!! Fwurm UNIX for Dummies Questions & Answers 15 11-06-2001 02:53 AM
how do u remove a messed up freebsd boot installation? coffeecoolers UNIX for Dummies Questions & Answers 1 08-05-2001 07:48 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-06-2008
Registered User
 

Join Date: Nov 2007
Posts: 30
I think I have messed up with crontab

Hi
Guy,

In my system there were some cronjob were already scheduled. and somehow I want to enter one new cronjob with crontab. So I isssue crontab temp.txt. it scheduled that job but now it's showing me only this job with crontab -l. but I can not see the old cronjob list that already set up. Is there anyway to set back those cronjob. i am guessing I have messed up those things. please give me clue to get back old cronjob.

Thanks,
Vishal
Reply With Quote
Forum Sponsor
  #2  
Old 03-06-2008
HPAVC's Avatar
Registered User
 

Join Date: Feb 2008
Posts: 105
Typically what you see in /var/spool/cron/crontabs (or similar) is what you get, unless you have some version control or .bak files from your editor stashed away locally.
Reply With Quote
  #3  
Old 03-06-2008
Bughunter Extraordinaire
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,262
Your command told cron to copy this file (temp.txt) over the old file (/var/spool/cron/crontabs/<username> or similar), so the old version is gone like boxing champions: never to come back.

The only way to get it back is doing a resore of some sort: if a daily backup of the system is made the crontab should be in there and you can restore it. I don't know your system, if it is AIX: ask the other systems administrators about the "mksysb" and restore it from there.

Probably there is some tape backup of the system where you can find the old crontab file.

Another possibility is that the crontab files are in some sort of version control system, so the last version could be restored from there.

If you have displayed the old crontab on your screen before and haven't done that much in this particular window you could try to find the old contents of the crontab file in the screen buffer. Use (this is true for xterms, other terminals might work differently) <SHIFT>-<PgUp> to scroll upwards until you find the crontabs contents, use copy&paste to put it into a file and use the command you already know - "crontab filename" - to put it back into place.

I hope this helps.

bakunin
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:02 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0