Crontab : how to recover from corrupt internal cron database ?
Solaris / OpenSolarisThis forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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___
~
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:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.