UNIX for Advanced & Expert Users

Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Crontab file

👤 Login to reply

    #1  
Old 07-28-2008
mradsus mradsus is offline
Registered User
 
Join Date: Jul 2008
Last Activity: 5 August 2008, 4:30 AM EDT
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Crontab file

Hi All,
I created a crontab entry in a cron.txt file accidentally entered
crontab cron.txt.

Now my previous crontab -l entries are not showing up, that means i removed the scheduling of the previous jobs by running this command "crontab cron.txt"

How do I revert back to previously schedule jobs.
Please help. this is urgent.,
Thanks.
Sponsored Links
    #2  
Old 07-28-2008
zaxxon's Unix or Linux Image
zaxxon zaxxon is offline Forum Staff  
code tag tagger
 
Join Date: Sep 2007
Last Activity: 6 July 2018, 8:04 AM EDT
Location: St. Gallen, Switzerland
Posts: 6,574
Thanks: 178
Thanked 569 Times in 483 Posts
Restore the crontab for this user from your backup.
Sponsored Links
    #3  
Old 07-28-2008
mradsus mradsus is offline
Registered User
 
Join Date: Jul 2008
Last Activity: 5 August 2008, 4:30 AM EDT
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
I dont know where is the crontab file locatedfor the scheduled jobs.
If I can do it from the backups, can you give me the commands.
    #4  
Old 07-28-2008
ynilesh's Unix or Linux Image
ynilesh ynilesh is offline
Registered User
 
Join Date: Oct 2007
Last Activity: 7 April 2009, 7:39 AM EDT
Location: Bangalore, India.
Posts: 222
Thanks: 0
Thanked 0 Times in 0 Posts
There are no special commands for that. Just read old backup crontab and put it in,
Code:
crontab -e

and save it.
Sponsored Links
    #5  
Old 07-28-2008
mradsus mradsus is offline
Registered User
 
Join Date: Jul 2008
Last Activity: 5 August 2008, 4:30 AM EDT
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
I dont know where the old backup of crontab is located.
How to find it.
Sponsored Links
    #6  
Old 07-28-2008
jhtrice's Unix or Linux Image
jhtrice jhtrice is offline
Registered User
 
Join Date: Jun 2008
Last Activity: 10 September 2010, 7:09 AM EDT
Posts: 75
Thanks: 0
Thanked 1 Time in 1 Post
Ask your sys admin to restore it for you.
Sponsored Links
    #7  
Old 07-28-2008
lestat_ecuador lestat_ecuador is offline
Registered User
 
Join Date: Oct 2006
Last Activity: 26 August 2009, 6:43 PM EDT
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Try to go to /tmp and do

Code:
ls -ltr cron*

Then will appear kind a history of the cron, see the creation dates an look into the one you want. For example I have:

Code:
usuario: > cd /tmp/
usuario: /tmp > ls -ltr cro*
-rw-------   1 ecopge   ecuador      859 Jul 25 08:33 crontabJhaiKP
-rw-------   1 ecppga   ecuador        0 Jul 28 16:00 croutFNZCuVqsb

I already modify my crontab file, it is into croutFNZCuVqsb but my last crontab file is into [B]crontabJhaiKP[B].

try it and let me know how are you going.
Sponsored Links
👤 Login to reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problem with crontab file bobble14988 UNIX for Dummies Questions & Answers 2 08-10-2011 09:21 AM
Question about crontab file! shipon_97 Red Hat 2 10-14-2009 03:23 PM
How to edit the crontab file rajus19 Shell Programming and Scripting 2 05-25-2007 08:34 AM
crontab file mclaughline Filesystems, Disks and Memory 1 08-17-2005 10:21 PM
/bin/sh: /usr/bin/vi: No such file or directory when doing crontab kwalter UNIX for Dummies Questions & Answers 3 05-15-2001 11:13 AM



All times are GMT -4. The time now is 11:13 PM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?