Auto-shutdown for Linux machine

If you want to schedule more than just a shutdown, crontab is the tool generally used for running commands on a recurring schedule.

You should to be root:

# su
Then, type the root's password

Then, use this command:

# crontab -e
Add the following line:

55 18 * * /sbin/shutdown -h 19:00

It will auto-shutdown computer at 19:00 (after prompt users at 18:55) everyday.

To make it works immediately, you need to restart cron service:

# /etc/init.d/crond restart

That's it. :)


Anonymous said…
Hello, as you may already noticed I am newbie here.
I will be happy to get any help at the start.
Thanks in advance and good luck! :)
acliv77 said…
Dạ, anh ơi. Có phải lập lịch tắt rùi thì hằng ngày nó sẽ tắt theo giờ đó. Vậy làm sao để hủy việc lập lịch này ạ. :). sorr, vì em chưa làm việc với Linux nhìu, đang ráng học hỏi ạ.
I like your blog features.This is one of the aggressive and good post.Thanks for your support.
Android app developer

Popular Posts