//
you're reading...
Linux

Auto Shutdown In linux


There are some times when you need to turn automatically your PC off, there can be a lot of examples when this is necessary.

I usually do this when I left some torrent downloading, let’s say some Linux isos to test a new Linux distribution, so I leave my PC downloading the ISO at office over the weekend, and program my PC to turn of, some two or three hours after the estimated time when the download is suppose do finish.

I do not have too much bandwidth so a whole DVD can take some 26 hours downloading. Specially because I limit the usages of bandwidth to 50% of the available to leave room for other tasks.

Well, let’s see how to do it.

sudo shutdown -h -P [hour]:[minutes]

This is only useful, if you need to shutdown the computer on the same day you are, or the next one, let’s suppose it is noon, and you want to shutdown your computer at 17 hours.

sudo shutdown -h -P 17:00

But if you need to shutdown your computer the day after tomorrow, or even later, use this commands.

sleep 2d 3h | poweroff

You need to run that command as root, or using sudo, but you need to be in thesudoers file, and not required to enter passwords.

That command is going to shutdown the computer after 2 days and 3 hours from now

source : http://www.go2linux.org

Advertisements

About abdessemed mohamed amine

DZ-SECURITY

Discussion

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Facebook

November 2010
S M T W T F S
« Sep   Dec »
 123456
78910111213
14151617181920
21222324252627
282930  

Twitter

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

  • 364,474 Visit !
%d bloggers like this: