PDA

View Full Version : I need some help with a script



gletob
March 15th, 2009, 12:24 AM
Ok I'm looking to have a script that runs on boot that sets my bios RTC Alarm to boot the pc at 5:00:00 (Eastern Standard with Daylight saving).

I've been reading this guide about RTC Alarm in Mythbuntu but I'm on ubuntu.

http://www.mythtv.org/wiki/ACPI_Wakeup#Initiate_manually_2

I followed the initialize manually instructions and it works.

gletob
March 15th, 2009, 12:58 AM
Ok I'm looking to have a script that runs on boot that sets my bios RTC Alarm to boot the pc at 5:00:00 (Eastern Standard with Daylight saving).

I've been reading this guide about RTC Alarm in Mythbuntu but I'm on ubuntu.

http://www.mythtv.org/wiki/ACPI_Wake...ate_manually_2

I followed the initialize manually instructions and it works.

gletob
March 15th, 2009, 01:52 AM
Anyone????

Eisenwinter
March 15th, 2009, 01:57 AM
Start reading (http://tldp.org/LDP/abs/html/)

;)

unutbu
March 15th, 2009, 02:47 AM
Put this in /usr/local/bin/wake_tomorrow


#!/usr/bin/env python
import datetime
import os
now=datetime.date.today()
oneday=datetime.timedelta(days=1)
tomorrow=now+oneday
morning=datetime.datetime(tomorrow.year,tomorrow.m onth,tomorrow.day,5,0,0)
os.system('echo %s > /sys/class/rtc/rtc0/wakealarm'%morning.strftime('%s'))

Make it executable:

chmod 755 /usr/local/bin/wake_tomorrow

Run


sudo /usr/local/bin/wake_tomorrow
cat /sys/class/rtc/rtc0/wakealarm
cat /proc/driver/rtc

to see if it set the alrm_date and alrm_time as desired.
If everything looks fine, then next, edit /etc/rc.local by putting


/usr/local/bin/wake_tomorrow

on the second to last line (above "exit 0"). This will make the machine run wake_tomorrow during each boot.

gletob
March 15th, 2009, 04:58 AM
Thank you so much that will work perfectly! If there was still a "thanks" button I would push it.

gletob
March 15th, 2009, 05:00 AM
Start reading (http://tldp.org/LDP/abs/html/)

;)

Good Gosh! I think I'll bookmark that it seems interesting.

BTW someone posted an answer.

http://ubuntuforums.org/showthread.php?p=6896686

bapoumba
March 15th, 2009, 06:27 PM
Moved to PT and one post quoting spam deleted.

drubin
March 15th, 2009, 08:38 PM
Anyone????

Please don't bump a thread that isn't even 1 hour old. Things take time to answer.

bapoumba
March 16th, 2009, 09:28 PM
Threads merged.