Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'm having an issue with a scheduled shutdown command in crontab.
I recently installed my new server with mandriva 2011 and just as with my previous linux box I want it to shutdown at 2 at night.
So as with my old box I added a 'shutdown -h 1' command in crontab, but for some reason my box didn't shutdown at 2:01. (shutdown in mandriva works with minutes)
Now I allready figured out that mandriva 2011 seems to have an error/feature where you need to put a + in front of the time where that wasn't needed in 2010.
So now my crontab line says:
0 2 * * * shutdown -h +1 #shutdown at night
But for some reason it doesn't shutdown
other crontab lines seem to work just fine.
I also tried changing the crontab through webmin and automatically the shutdown doesn't happen, however if I say 'run now' from webmin the command executes just fine.
I had a look at /var/errors/cron/errors.log and I saw this error at a time where the shutdown should have run:
(CRON) EXEC FAILED (/usr/sbin/sendmail): no such file or directory
So I'm guessing there's an error somewhere which cron is trying to mail me, but I'm at a loss to what the error is, especially since the command runs fine when I start it from webmin's scheduled cron jobs module.
Hopefully somebody can give me a helping hand.
edit: forgot to mention the crontab user is root.
Last edited by RagingRaven; 09-17-2011 at 09:17 AM.
adding /sbin/ appears to be working (not 100% sure yet, because I can't actually let it shutdown now, but I did get the message where before I didn't)
So am I right in thinking both your answers point to the same thing...a missing path?
In other words will it also work if I add the PATH variable to crontab and change the command back to 'shutdown -h +1' ?
In any case thanks for helping me out so far and I'll set this topic to solved as soon as my box shuts down at 2 tonight