LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Suse/Novell (http://www.linuxquestions.org/questions/suse-novell-60/)
-   -   Howto schedule shutdown daily (http://www.linuxquestions.org/questions/suse-novell-60/howto-schedule-shutdown-daily-722511/)

drsethi 04-29-2009 12:14 PM

Howto schedule shutdown daily
 
I want to schedule shutdown my computer daily at 08:00:01 AM.
Describe the method with Kcron or any other software

colucix 04-29-2009 01:26 PM

You can easily set up a crontab to do the job. Open a terminal and switch to root (since only root can use the shutdown command):
Code:

su -
then edit the root's crontab using
Code:

crontab -e
now you are into the vi editor. Add the following line:
Code:

0 8 * * * /sbin/shutdown -h now
save and quit and the trick is done. If you don't know how to use the vi editor, just press "a" to insert new text, type the text (the above line) then press "Esc". To save and quit digit ":wq!", then press enter. If you prefer to use a graphical editor, just set the environment variable EDITOR to the name of your favorite editor, for example:
Code:

export EDITOR=kwrite
then issue the crontab -e command. This time a session of kwrite pops up. Put the same crontab entry, save an quit.

About using kcron, you can find instructions here.


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