Sponsored Content
Top Forums Shell Programming and Scripting I think I have messed up with crontab Post 302173385 by bakunin on Thursday 6th of March 2008 03:04:49 PM
Old 03-06-2008
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
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how do u remove a messed up freebsd boot installation?

i messed up while installing freebsd into a dual os wannabe system. Now, how do i del it( so i wouldn't get prompted to choose freebsd during boot?)so that i could try installing a different flavour of linux? cheers:eek: (1 Reply)
Discussion started by: coffeecoolers
1 Replies

2. UNIX for Dummies Questions & Answers

Messed up tar files

I created tar files for directories using this command: tar -cvf * >tarfile what happened was I got a file tarfile with a list of the files and it took the first file in each directory and overwrote it with the actual tar file. I've been trying to figure out since yesterday what I did... (2 Replies)
Discussion started by: Barb
2 Replies

3. AIX

Totally messed up

I have moved the etc/passwd file and we are now unable to get in to Unix - any suggestions? (2 Replies)
Discussion started by: vbagwell
2 Replies

4. UNIX for Dummies Questions & Answers

Can't loging because .basrc file messed up

Dear Friends, I have messed up with my .bashrc file (something I have deleted) and now i can't login back to system.. any Idea.. I can do login with other login and password.. but I dont have root password because of security reason... If I ask root then It will take about 4 -5 days to go... (4 Replies)
Discussion started by: umeshjaviya
4 Replies

5. UNIX for Dummies Questions & Answers

Messed up my boot environment or root profile

Ok, a couple weeks ago I was fixing a cron report about perl not happy with 'locale' info (LANG and LC not set). As a result, I was experimenting with setting the correct 'locale' in several areas (like /etc/sysconfig/i18n and who knows where). Somehow after a reboot, as soon as the OS starts... (3 Replies)
Discussion started by: Garball
3 Replies

6. Linux

history timestamp is messed up

Hi, Just wanted to know if anyone else has noted that the time-stamp in the history is all out of whack.:eek: I've Ubuntu, all patched, and when I ran history, it showed me commands that I ran few weeks ago with today's date. Is this normal? Here is a snippet: .... 85 2010-06-09 09:03:31... (6 Replies)
Discussion started by: nitin
6 Replies

7. UNIX for Dummies Questions & Answers

messed up path

Help!! Seem to have messed up my path, as I keep getting command not found error. Could someone please tell whats wrong or how to fix it. export PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:$PATH ---------- Post updated at 08:34 PM ---------- Previous update was at 07:50 PM ---------- ... (1 Reply)
Discussion started by: davcra
1 Replies

8. UNIX for Dummies Questions & Answers

txt file gets messed up during transfer from my Desktop

Hi, I am working off of a MacBook Pro OSx 10.5.8. I have a tab deliminted text file on my desktop that I created in excel. It has 4 columns and 20,000 rows. When I scroll down it in excel, everything lines up perfectly, and is where it is supposed to be. After copying it into my terminal... (6 Replies)
Discussion started by: lrae
6 Replies

9. Ubuntu

Messed up password

I am unable to change my password even in root (recovery mode), or to unlock it. I can still access my account, but without password protection. In GUI Administrator account 'disabled' is displayed. This is what I have done so far: In root:#usermod -U roy usermod:cannot lock /etc/passwd;... (9 Replies)
Discussion started by: Royalist
9 Replies

10. HP-UX

Ignite-UX INDEX file messed up, how to recreate?

OK, so I just messed myself up. Thinking the /var/opt/ignite/data/INDEX files was static, I manually edited the file and added 2 more OS's to it. During an Install it only showed the first OS (started with 11.31, 3 versions then added a 11.23, and a 11.11 stanza's). The 11.23 and 11.11 never... (2 Replies)
Discussion started by: mrmurdock
2 Replies
CRON(8) 						      System Manager's Manual							   CRON(8)

NAME
cron - daemon to execute scheduled commands (Vixie Cron) SYNOPSIS
cron DESCRIPTION
Cron should be started from /etc/rc or /etc/rc.local. It will return immediately, so you don't need to start it with '&'. Cron searches /var/spool/cron for crontab files which are named after accounts in /etc/passwd; crontabs found are loaded into memory. Cron also searches for /etc/crontab and the files in the /etc/cron.d/ directory, which are in a different format (see crontab(5)). Cron then wakes up every minute, examining all stored crontabs, checking each command to see if it should be run in the current minute. When execut- ing commands, any output is mailed to the owner of the crontab (or to the user named in the MAILTO environment variable in the crontab, if such exists). Additionally, cron checks each minute to see if its spool directory's modtime (or the modtime on /etc/crontab) has changed, and if it has, cron will then examine the modtime on all crontabs and reload those which have changed. Thus cron need not be restarted whenever a crontab file is modified. Note that the Crontab(1) command updates the modtime of the spool directory whenever it changes a crontab. SEE ALSO
crontab(1), crontab(5) AUTHOR
Paul Vixie <paul@vix.com> 4th Berkeley Distribution 20 December 1993 CRON(8)
All times are GMT -4. The time now is 09:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy