The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
crontab couldn't run through, help duke0001 UNIX for Advanced & Expert Users 10 02-06-2008 12:22 AM
help with crontab bob122480 Shell Programming and Scripting 3 01-22-2007 05:49 PM
Crontab gen4ik UNIX for Dummies Questions & Answers 1 01-18-2007 04:26 AM
ftp and crontab user` Shell Programming and Scripting 27 11-13-2006 05:02 PM
Crontab lo-lp-kl UNIX for Dummies Questions & Answers 2 05-05-2005 03:21 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 04-26-2002
Registered User
 

Join Date: Jul 2001
Location: dc
Posts: 25
Unhappy crontab

does anyone know how to get the crontab back?

i have erased it by mistake!

thanx in advance
Forum Sponsor
  #2  
Old 04-26-2002
Kelam_Magnus's Avatar
Registered User
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
crontab filename

Slow down... You are most likely not in trouble here...

Maybe you didn't "erase", you probably just pointed it at a new config file.

If you typed "crontab somefile" you only replaced it with another file.

Depending on your system OS, go /var/spool/cron/crontabs directory.

Do an ls and look for a file called "root"
If there, do a cat to see if that is your original crontab.

Then do a "crontab root" to relink it to the crontab.

If you typed crontab somefile. That file will replace your crontab file.

To prevent you from doing this in the future, I would suggest the following.

________________________________
In a directory where you keep config files. I make a dir called /root/mydir.

cd /root/mydir
crontab -l > mytempcron # this will save a copy of your crontab file for root or whomever you are logged in as at the moment.

Then if you want to change the crontab.

vi mytempcron # edit the file to your specifications.

Then to move into place.

crontab mytempcron # use the crontab command to assign a file for the crontab to read and execute.

__________________________


If you actually deleted root's cron config file. Then you may be in trouble. If you have a backup utility, that may be your saviour.
__________________
My brain is your brain
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:38 PM.


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