Crontab file


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Crontab file
# 1  
Old 07-28-2008
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.
# 2  
Old 07-28-2008
Restore the crontab for this user from your backup.
# 3  
Old 07-28-2008
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
There are no special commands for that. Just read old backup crontab and put it in,
Code:
crontab -e

and save it.
# 5  
Old 07-28-2008
I dont know where the old backup of crontab is located.
How to find it.
# 6  
Old 07-28-2008
Ask your sys admin to restore it for you.
# 7  
Old 07-28-2008
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Crontab No such file or directory

I keep getting the crontab No such file or directory error message. 0,30,31,32,33,34,35,36,37,38,39,40 * * * * "/bin/ps aux --sort -\%mem >> /home/m/bob/cookies" I have made sure my directory exists. find /home/m/bob -iname 'cookies' 2>/dev/null /home/m/bob/cookies I am using the full... (3 Replies)
Discussion started by: cokedude
3 Replies

2. UNIX for Dummies Questions & Answers

Not able to edit crontab file

Hi, I have a solaris 10 box. And I want to schedule a cronjob.But it gives the following error bash-3.2$ crontab -l crontab: can't open your crontab file. bash-3.2$ EDITOR=vi bash-3.2$ export EDITOR bash-3.2$ crontab -e crontab: can't open your crontab file. I checked in... (12 Replies)
Discussion started by: Rossdba
12 Replies

3. Solaris

Crontab file issue

Hi guys, I edited my crontab file and entered this enter: * * * * * w >> `date +%F`.who Then I later deleted the above entry and entered : * * * * * w >> /rpool/who/w.txt when I login and ran : crontab -e I get this entry: * * * * * w >> `date +%F`.who Instead of this entry: *... (3 Replies)
Discussion started by: cjashu
3 Replies

4. UNIX for Dummies Questions & Answers

crontab and calling a .sh file

Hey out there. I have a .sh file I am calling from cron that I am trying to use to shut down the app at midnight. I have a file that does it and works just fine if I run it by typing "bash crontabstop.sh" from a command prompt. But if I call the file from a crontab I get this output.... (5 Replies)
Discussion started by: vsekvsek
5 Replies

5. Shell Programming and Scripting

Shell Script to grep Job File name and Log File name from crontab -l

Hello, I am new to shell scripting. I need to write a shell script where i can grep the name of file ie. .sh file and log file from crontab -l. #51 18 * * * /home/oracle/refresh/refresh_ug634.sh > /home/oracle/refresh/refresh_ug634.sh.log 2>&1 #40 17 * * * /home/oracle/refresh/refresh_ux634.sh... (1 Reply)
Discussion started by: guptra
1 Replies

6. UNIX for Dummies Questions & Answers

Problem with crontab file

I have a crontab file called /var/spool/cron/root with these contents. When I use the command, crontab -l, these are the contents which are displayed. HOME=/ MAILTO=maintenance@mycompany.com; robl@mycompany.com PATH=/sbin:/bin:/usr/sbin:/usr/bin SHELL=/bin/bash ##run-parts... (2 Replies)
Discussion started by: bobble14988
2 Replies

7. Shell Programming and Scripting

How to edit the crontab file

Hi All, There are some cron jobs scheduled already by someone, now I have to make some changes to the schedule timings. Please advise me. thanks, Raju (2 Replies)
Discussion started by: rajus19
2 Replies

8. Shell Programming and Scripting

Reformat Crontab file

I need help writing a script that will reformat a crontab file. The first thing the script is doing is a crontab -l > crontab.txt. I need the crontab.txt file to read "8.00 PM every weekday (Mon-Fri) only in Oct." instead of the orig format "0 20 * 10 1-5" (1 Reply)
Discussion started by: alnita
1 Replies

9. Shell Programming and Scripting

need help to write crontab file

hello Unix Guru's I need help to write crontab .. i want to run my script everyday . It should start after 12:00 midnight everyday . But on Friday i dont want to start that script at 12:00 midnight but want to start after 3:00 a.m . any way to write cronttab like this .. my... (4 Replies)
Discussion started by: deepa20
4 Replies

10. Filesystems, Disks and Memory

crontab file

Does any know if crontab files are automatically backed up anywhere? I am trying to track down when I specific entry was added to one of my crontab files and cannot just use the most recent timestamp on the latest version of the file. (1 Reply)
Discussion started by: mclaughline
1 Replies
Login or Register to Ask a Question