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

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.

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