LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   schedule a shutdown (https://www.linuxquestions.org/questions/linux-server-73/schedule-a-shutdown-534727/)

Mow 03-05-2007 08:16 AM

schedule a shutdown
 
I have a Debian server that I want to shutdown on a schedule for maintenance reasons but am scratching my head on it. I was attempting to use the /sbin/halt command but that can only be run as root (right?) .. anyone have any good ideas on this?

Thanks.

MensaWater 03-05-2007 08:21 AM

schedule = cron (or at).

You can tell it to start the shutdown (man shutdown) in cron (man cron). If it's in root's crontab (man crontab) it will run it as root.

Make sure you specify a warning message at the command line so it doesn't ask you if you want to send your own message as that prompt would prevent the shutdown from proceeding until answered.

Mow 03-05-2007 08:29 AM

perfect thanks.


All times are GMT -5. The time now is 10:07 PM.