I am having a simple cron job at my fedora linux i.e. to halt the machine at given time. But my cron job is not getting activated at all. Pl. guide me regarding this. Regards. Milind asked 05 May '10, 11:24 Milind |
You can trace this problem. Look in /var/log/cron and see if there are errors. If there are none, you may not be running cron with adequate logging. Look in your startup scripts for where crond starts. I'm not totally familiar with Fedora, but go to /etc/rc3.d or /etc/init.d and "grep crond *" and find which script starts crond. They use -lnn for the loglevel. I use -l10 for a lot of logs because I want to know what the problems are. Change it so it starts with a higher number like 10. Cron problems usually revolve around the shell. When crond triggers an action, it starts without your normal shell. If you are relying on a PATH or other environment variables, they are not going to be available. You need to hard code the location of executables. Like, instead of
You need to explicitly state where it is, like this:
Some environment variables are available to you, like $HOME. If you want to see what is available, set up a cron job like this:
so that it goes off in the next minute or two, then look in the output file and see what environment variables are available to you. answered 05 May '10, 14:35 codebunny |
Could you please provide some more details? What does your cronjob look like? Are you using "crontab -e" to edit it, and are you doing it as root? answered 05 May '10, 11:31 feinom Also make sure your cron daemon is running. There are a variety of daemons out there so I am not sure which one you are using however they all genereally contain the word "cron" so using the below command should be sufficient; ps aux | grep cron
(05 May '10, 16:10)
gjcwilliams
|
i hope you tell me if this works or not??? service crond status [if you are using crontab ] orservice atd status [if you are using at]if the command replied you as running then i suppose you want to poweroff the machine i do it in my RHEL 5.5 this way at 10 pm at 2000at > poweroff CTRL+D [twice] [this will run only once if you do a crontab it will execute repetedly at the same time write back i will guide you to that too] hope it helps a bit. answered 07 May '10, 13:59 rituraj.goswami |
I suggest tailing /var/log/cron to see what jobs are getting run.
I've also seen cronjobs hang indefinitely (because the jobs started don't exit in a timely fasion). Checking the number of crond instances can expose a situation where jobs are starting, piling up, and not exiting.
If you have a pile of them, use can use answered 11 May '10, 20:46 memnoch_proxy |
The simplest answer is usually "permissions". If your trying to shutdown the system, assuming your cron syntax is correct, I'm going to assume that you're doing it as a regular user. If that's the case then you probably just don't have rights to shutdown the system. answered 13 May '10, 14:36 JD50 |
Please accept an answer, or provide more details on what you're looking for.