Results 1 to 10 of 10

Thread: I need some help with a script

  1. #1
    Join Date
    Jun 2007
    Location
    VA
    Beans
    187
    Distro
    Ubuntu 10.04 Lucid Lynx

    I need some help with a script

    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.
    Last edited by gletob; March 15th, 2009 at 01:52 AM.

  2. #2
    Join Date
    Jun 2007
    Location
    VA
    Beans
    187
    Distro
    Ubuntu 10.04 Lucid Lynx

    RTC Alarm Script

    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.

  3. #3
    Join Date
    Jun 2007
    Location
    VA
    Beans
    187
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: I need some help with a script

    Anyone????

  4. #4
    Join Date
    Jun 2006
    Location
    Israel
    Beans
    292

    Re: I need some help with a script


  5. #5
    Join Date
    Mar 2008
    Beans
    4,714
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: RTC Alarm Script

    Put this in /usr/local/bin/wake_tomorrow
    PHP Code:
    #!/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.month,tomorrow.day,5,0,0)
    os.system('echo %s > /sys/class/rtc/rtc0/wakealarm'%morning.strftime('%s')) 
    Make it executable:
    Code:
    chmod 755 /usr/local/bin/wake_tomorrow
    Run
    Code:
    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
    PHP Code:
    /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.

  6. #6
    Join Date
    Jun 2007
    Location
    VA
    Beans
    187
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: RTC Alarm Script

    Thank you so much that will work perfectly! If there was still a "thanks" button I would push it.

  7. #7
    Join Date
    Jun 2007
    Location
    VA
    Beans
    187
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: I need some help with a script

    Quote Originally Posted by Eisenwinter View Post
    Good Gosh! I think I'll bookmark that it seems interesting.

    BTW someone posted an answer.

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

  8. #8
    Join Date
    Sep 2006
    Location
    France.
    Beans
    Hidden!
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: I need some help with a script

    Moved to PT and one post quoting spam deleted.
    | My old and mostly abandoned blog |
    Linux user #413984 ; Ubuntu user #178
    J'aime les fraises.
    Nighty night me lovelies!

    | Reinstalling Ubuntu ? Please check this bug first ! |
    | Using a ppa ? Please install ppa-purge from universe, you may need it should you want to revert packages back |
    | No support requests / username changes by PM, thanks. |

  9. #9
    Join Date
    Feb 2008
    Location
    Cape Town, South Africa
    Beans
    Hidden!
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: I need some help with a script

    Quote Originally Posted by gletob View Post
    Anyone????
    Please don't bump a thread that isn't even 1 hour old. Things take time to answer.

  10. #10
    Join Date
    Sep 2006
    Location
    France.
    Beans
    Hidden!
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: I need some help with a script

    Threads merged.
    | My old and mostly abandoned blog |
    Linux user #413984 ; Ubuntu user #178
    J'aime les fraises.
    Nighty night me lovelies!

    | Reinstalling Ubuntu ? Please check this bug first ! |
    | Using a ppa ? Please install ppa-purge from universe, you may need it should you want to revert packages back |
    | No support requests / username changes by PM, thanks. |

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •