Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Turn machine on/off.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
justincataldo
Guru
Guru


Joined: 15 Jun 2005
Posts: 376
Location: Australia

PostPosted: Mon Oct 16, 2006 12:04 am    Post subject: Turn machine on/off. Reply with quote

In Apple OSX you can schedule a time for the machine to boot and turn off all by itself.

How the hell does it do that? Via a cron job?

Can this be done in linux?
Back to top
View user's profile Send private message
Freakazoid
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2004
Posts: 104

PostPosted: Mon Oct 16, 2006 12:09 am    Post subject: Re: Turn machine on/off. Reply with quote

justincataldo wrote:
In Apple OSX you can schedule a time for the machine to boot and turn off all by itself.

How the hell does it do that? Via a cron job?

Can this be done in linux?


don't see why it could't be done in linux, provided proper ACPI support for software power off is compiled in the kernel.
I can think of one of two methods of doing this: cron (I think), and "at" (totally forget which package has "at" unfortunately)

basically you'd just schedule a "poweroff" or a "shutdown -t now" whever you want the machine to turn itself off.
Back to top
View user's profile Send private message
justincataldo
Guru
Guru


Joined: 15 Jun 2005
Posts: 376
Location: Australia

PostPosted: Mon Oct 16, 2006 12:10 am    Post subject: Reply with quote

I see.

What about turning the machine on?
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Mon Oct 16, 2006 12:11 am    Post subject: Reply with quote

Yes you can do that with cron. (as root at least)

Just execute the command "shutdown -h now".

The are several GUI for easily setting the cron command and time. (kcron for example)

Edit: Damn, guess someone types faster. :)


Last edited by Headrush on Mon Oct 16, 2006 12:31 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55239
Location: 56N 3W

PostPosted: Mon Oct 16, 2006 12:13 am    Post subject: Reply with quote

justincataldo,

You can set an alarm in the BIOS to wake up and boot. I'm not sure if that can be set from within Linux, probably not, because all BIOSes store settings differently although the Real Time Clock interface is standard.

You can't easly set a shutdown time but the shutdowm command takes a delay parameter in mimutes,
So
Code:
shutdown -h 5
shuts down in five minutes time. You could write a script to do arethmetic on the time.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum