LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 03-05-2007, 08:07 AM   #1
markraem
Member
 
Registered: Nov 2003
Posts: 82

Rep: Reputation: 15
Crontab : how to recover from corrupt internal cron database ?


Each time I try to modify (solaris 10) crontab via crontab -e, I get following message :

"The editor indicates that an error occurred while you were editing the crontab data - usually a minor typing error.
Edit again, to ensure crontab information is intact (y/n)?"

Even if I put "#" in front of every line of the crontab -e, I get the same message.

When I remove all the lines and try to save the empty crontab -e, then I get the message

"crontab: temporary file empty" but when I do crontab -e again, I still get the "old" crontab content as before I emptied it.

I suspect that my internal crondatabase is corrupted by a collegue who did not know what he/she was doing.

How can i recover from this situation ?

PS : here I show you the crontab -e :


#ident "@(#)root 1.21 04/03/23 SMI"
#
# The root crontab should be used to perform accounting data collection.
#
#
10 3 * * * /usr/sbin/logadm
15 3 * * 0 /usr/lib/fs/nfs/nfsfind
30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean
#10 3 * * * /usr/lib/krb5/kprop_script ___slave_kdcs___
~
 
Old 03-05-2007, 09:27 AM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,027
Blog Entries: 5

Rep: Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789
Try commenting out:
Code:
30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean
I suspect you're getting the message because cron doesn't really use a full shell for running jobs. It likely doesn't understand the shell test you're trying to include in that line.

It would be better to get rid of the test there altogether. If it isn't found or executable then it simply won't run. You'll see its failure in your cronlog. That is to say change the line to simply:
Code:
30 3 * * * /usr/lib/gss/gsscred_clean
 
Old 03-05-2007, 10:32 AM   #3
markraem
Member
 
Registered: Nov 2003
Posts: 82

Original Poster
Rep: Reputation: 15
Removing that line indeed helped !

I am a bit surprised becasue emptying the file did not help. So, I am surprised that removing this line helps me out.

thanks for your response !
 
Old 03-05-2007, 11:23 AM   #4
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,027
Blog Entries: 5

Rep: Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789
Emptying the file changed your message so it did "help". It was just the fact you got a different message that made it seem not to have helped.

Glad I could help. As noted you don't have to remove the line altoghether - just alter it to remove the shell test syntax it didn't like.
 
Old 03-05-2007, 04:02 PM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,522

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Quote:
Originally Posted by markraem
Each time I try to modify (solaris 10) crontab via crontab -e, I get following message :

"The editor indicates that an error occurred while you were editing the crontab data - usually a minor typing error.
Edit again, to ensure crontab information is intact (y/n)?"
My guess is this error is due to some unrecognized command in your .exrc file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
corrupt ext3 partition - need to recover whysyn Linux - Hardware 8 07-02-2010 09:30 AM
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U Suse/Novell 11 01-04-2007 02:57 AM
Recover corrupt data from SD Memory Card new2lin Linux - Desktop 1 12-28-2006 02:06 PM
Corrupt RPM database caribwave Red Hat 1 07-05-2005 03:16 PM
Help! Need to recover corrupt bzip2 files.. rhinomite Linux - General 3 02-15-2005 06:02 PM


All times are GMT -5. The time now is 08:11 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration