LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   Crontab : how to recover from corrupt internal cron database ? (https://www.linuxquestions.org/questions/solaris-opensolaris-20/crontab-how-to-recover-from-corrupt-internal-cron-database-534710/)

markraem 03-05-2007 07:07 AM

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___
~

MensaWater 03-05-2007 08:27 AM

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

markraem 03-05-2007 09:32 AM

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 !

MensaWater 03-05-2007 10:23 AM

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.

jlliagre 03-05-2007 03:02 PM

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.


All times are GMT -5. The time now is 10:21 AM.