|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Crontab-problem....please help
I had submitted this problem earlier in this forum..but couldn't get proper solution. Now again I am back to the same. Please shed some light on this.
I am in a login account which is equivalent to root. So obivously I have the permission to submit cronjobs. But frquently I am getting the following mails to root. From: Super-User <root> Message-Id: <200512151515.jBFFF1t21018@hasmsd.hss.hns.com> To: root Subject: can't access your crontab file. Resubmit it. Content-Type: text Content-Length: 53 The error on hasmsd was "No such file or directory" My account is in such a way that the /var/spool/cron/crontabs/root is the crontab file. This is already there. Then why I am getting that mail? The timing for the mail generation is absolutely random. I am running some scripts where again crontab [filename] is called. I doubted because of this, the problem happens. But even after removing those lines, the mails are getting generated. One more thing I want to ask is, if two users are using the same crontab files are there any problems expected? What exactly is crontab [filename] call doing? Does this crontab call at any point delete the /var/spool/cron/crontabs/root file? I came to know that when crontab is again called, this will temporarily removes he existing cronjobs. but the file should exist, right? I could see from Unix cron.c that when stat function is returning error for this user crontab file, the this error is set. For detials: http://cvs.opensolaris.org/source/xref/on/usr/src/cmd/cron/cron.c#BADSTAT But when all these stat fails? This is a long query..but anyway, please respond with your ideas. Thanks a lot, msima |
|
#2
|
|||
|
|||
|
First things first - what is your O/S (Solaris 10?)? It seems that you can't see the forest for the trees - you're looking at source code when you should first enable some logging - take a look at both the crontab man page and the syslogd man page to make sure that you're logging what cron is doing.
Next, what are the commands that you're using? The traditional command line (which you know from doing a man cron) is "crontab -e" for the user you want to run the cron as. Lastly, remember that cron runs with a very restricted environment (which, of course, you read in the man page ). The path that you have in the shell is likely to be way more than is available to you via cron.
__________________
Need Java help? Want to help people who do? Sit down with a cup of Java at the hotjoe forums. |
|
#3
|
|||
|
|||
|
The OS is Solaris 2.8
cron outputs are logged and there is nothing strange in the log. Also the command used in the script was crontab <file name> which is used to set the the content of the file as cronjob for that user. I would like to know what exactly crontab <file name> does on cron. Thanks, msima |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Crontab-problem....please help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|