Automatic Turn On/Off PC and Modem

  • Thread starter Thread starter cupid
  • Start date Start date
  • Replies Replies 15
  • Views Views 6,076

cupid

Newbie
Messages
13
Location
NA
ISP
BSNL
I use both linux( Ububtu 9.10 and after) and Windows( Xp ) Os's to browse web.I use night unlimited scheme (2-8 am) broadband plan...The situation is Every night i have to get up at nearby 2am and then wake up and sit in front of PC till 8am ... to shut down my modem at 8am... This is very hectic... Is there any way so that i can automate the process turn on/off my pc and modem i.e., turn on automatically and then connect to my internet connection.. and then shut down at 8am...I use both linux & windows... So if possible can some one... suggest me anything..
 
TIPS

There are 3 things to consider.
1) power on time is 2AM (we will power on 2mins after 2am though)
2) 2am today or tomorrow
3) timezone

If today is 25th June 11PM and u want to schedule it tonight at 2AM...command wud be

Code:
echo `date  '+%s' -d '2am next day + 332 minutes'` > /sys/class/rtc/rtc0/wakealarm
If today is 26th June 1AM and u want to schedule it tonight at 2AM...command wud be

Code:
echo `date  '+%s' -d '2am + 332 minutes'` > /sys/class/rtc/rtc0/wakealarm

Here i have assumed that u r in India so timezone is +5:30 = 330minutes, 2 minutes I have added as safe margin just incase ISP time is little late.

Note: Sometimes ur BIOS's time is already in UTC mode.. in that case you dont have to add 332 minutes.


To verify that alarm time is set, run this command:
Code:
cat /proc/driver/rtc
Output wud be something like this:
rtc_time : 14:23:30
rtc_date : 2011-06-25
alrm_time : 02:02:00
alrm_date : 2011-06-26

if alrm_date shows stars .. like ****-**-26 this means that its not set and time u specified has already passsed. So play around with your time by adding/subtracting ur timezone minutes.

After the success, simply turn off ur computer and have a sleep-full night!

Sorry But i didnt checked it earlier..

Is it that you can activate RTC alarm from inside the Linux also ??
 
You can post ur issue here, that will help other ppl in future. And you might get reply from others as well.
 
Now Here is a small overview of my BIOS setupPower Management 1. APM configuration 2. ACPI Configuration1. APM Configuration has the following menusa. power management/APM - enabledb. video power down mode - disablec. hard disk power down mode - disabled. suspend time mode - disablee. throttle slow clock ratio - [50%]f. keyboard & PS/2 mouse [MONITOR]g. power button mode [on/off]h. advance resume event controls - ENABLE i. Resume on Ring - Disable ii. Resume on Lan - Disable iii. Resume on PME# - Disable iv. Resume on RTC ALARM Enable - Enable RTC Alarm Date ( Days ) [ EveryDay] RTC Alarm TIME [02:05:00]Things are not working.... the alarm is not working...
 
Set it for today first.. dont set for everyday.Also enable all items with "resume on ..."You will have to figure it out by trial and error.--- or best wud be simply go to linux and run command similar to above that i posted in one of my previous posts. but there too u wud have to do some trial error to figure out exact method of setting time.
 
Back