Scheduling StartUp and ShutDown












24















I use Torrents often, so I need to know how to make my computer start up and shut down automatically, Wi-Fi is switched on at six in the morning in my hotel and switched off at two AM. (I am able to schedule torrents, that's not a problem), I don't want my computer always plugged in to a power supply.










share|improve this question





























    24















    I use Torrents often, so I need to know how to make my computer start up and shut down automatically, Wi-Fi is switched on at six in the morning in my hotel and switched off at two AM. (I am able to schedule torrents, that's not a problem), I don't want my computer always plugged in to a power supply.










    share|improve this question



























      24












      24








      24


      16






      I use Torrents often, so I need to know how to make my computer start up and shut down automatically, Wi-Fi is switched on at six in the morning in my hotel and switched off at two AM. (I am able to schedule torrents, that's not a problem), I don't want my computer always plugged in to a power supply.










      share|improve this question
















      I use Torrents often, so I need to know how to make my computer start up and shut down automatically, Wi-Fi is switched on at six in the morning in my hotel and switched off at two AM. (I am able to schedule torrents, that's not a problem), I don't want my computer always plugged in to a power supply.







      power-management shutdown schedule






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 11 '16 at 19:47









      muru

      1




      1










      asked Nov 29 '11 at 8:44









      kernel_panickernel_panic

      4,119164077




      4,119164077






















          7 Answers
          7






          active

          oldest

          votes


















          19














          For a one-time shutdown you can use



          shutdown -h 02:00


          To schedule it you can use cron. There are some GUIs for it like gnome-schedule.



          But to start machine on schedule you have to look at BIOS/UEFI settings.



          Update: check the answers about MythTV and Wake on Plan below to schedule startup.






          share|improve this answer





















          • 1





            This question may be useful: How do I schedule waking up from hibernation?

            – Alba Mendez
            May 17 '12 at 10:17





















          12














          MythTV is able to shut down computer when it's no longer in use and wake it up a few minutes before the next recording starts. It does it by using ACPI functions to set wakeup time before shutting down. There is an extensive howto on configuring this, which basically boils down to:



          First verify that your Linux kernel is 2.6.22 or newer and the HWclock update function has been disabled as described above.



          Simple test to wake the machine 5 minutes from now



          sudo sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm"
          sudo sh -c "echo `date '+%s' -d '+ 5 minutes'` > /sys/class/rtc/rtc0/wakealarm"
          cat /sys/class/rtc/rtc0/wakealarm


          Check



          cat /proc/driver/rtc


          This should return a list of parameters. Check the "alrm_time" is 5 minutes into the future and the "alrm_date" is today.



          Shutdown your computer and see if it comes back up in ~5 min.



          sudo shutdown -h now  


          (in Ubuntu 10.4 "sudo shutdown -P now" (-h may cause system to restart))



          Of course, if you always need to shut the computer down at the same time and wake it up at the same time, you can just configure wake-up time in bios (if there's such an option) and schedule a shutdown right from init scripts






          share|improve this answer
























          • Great, didn't know about it. Should alrm_pending be 'yes' if alarm is set?

            – int_ua
            Nov 29 '11 at 11:37











          • On my machine alarm_pending is "no" even after I set the wake-up time using the script above. The machine wakes up perfectly though so I think this parameter means something else

            – Sergey
            Nov 29 '11 at 21:26



















          6














          I've written an application to schedule startup, it's called Wake on Plan.



          It's not available in the official repository yet (review pending) but you can start using it from PPA:



          https://launchpad.net/~xintx-ua/+archive/wakeonplan



          2014-2015 Update:



          I've created the QML version with Ubuntu SDK using phone as a target and hoping for easy porting to desktop over a year ago. But click packages were never ready for use on desktop and now I'm waiting until snappy packages will be. Please notify me when they are. Right now even snappy list -uv crashed on my 15.04x64 installation and it doesn't look ready at all. Or you can try building a deb packages yourself, I'll try to help as much as I can.






          share|improve this answer





















          • 1





            I've tried it (January 18th, 2013) and it works well under 12.10 — though there is no "Quantal" package. Is it under active development?

            – Ed Villegas
            Jan 19 '13 at 14:42











          • Thanks for the info :) Not really active as it's still wasn't approved due to one empty folder in the package that I can't find how to get rid of, check here: askubuntu.com/questions/221701

            – int_ua
            Jan 20 '13 at 6:05











          • And Quickly 12.08.x intended for usage under 12.10 breaks a lot, so I first wanted to finish the 12.04 version.

            – int_ua
            Jan 20 '13 at 6:08











          • Good luck and thanks for sharing your work!

            – Ed Villegas
            Jan 20 '13 at 6:49






          • 1





            Does this still work? If so, could you build packages for more recent Ubuntu versions please? :)

            – Seth
            Jul 12 '15 at 18:10



















          3














          Use cronjob to auto shootdown and auto power on. The command below will shutdown the computer at 02.00 AM and start the machine 4 hours later (14400 seconds)



          00 2 * * * root /usr/sbin/rtcwake -m off -s 14400





          share|improve this answer
























          • This seems like the simplest solution. Thank you!

            – mpen
            Jul 29 '17 at 5:27



















          1














          I'm using an older Ubuntu 10.04.4 LTS system, and I have had some success with the rtcwake command. Use it like this on the command line:



          # wake the system in 1 Hour:
          sudo rtcwake -s 3600 -m disk


          The -m disk option should put it in a low-power state, and depending on hardware support (i.e.: your own computer), you might even be able to successfully use -m off to fully power off.



          Also, you can put the above into the /etc/crontab to schedule it automatically every day.






          share|improve this answer































            0














            You can use shutdown command to schedule a shutdown. To shutdown at 2 AM you can use the following command:



            sudo shutdown -h 2:00


            You will need to run this command in terminal and leave the terminal open.



            Regarding startup, I dont think that it is possible for Ubuntu or any app running on it to switch on a computer. You will need hardware assistance for this for example you can use Wake on Lan.






            share|improve this answer
























            • Regarding startup - you're correct in a very narrow technical sense (because Ubuntu is not running when a computer is down), but with a bit of trickery it is possible to schedule a wakeup from a program/script. :)

              – Sergey
              Nov 29 '11 at 11:02











            • I don't think you need to keep the terminal open. You can stop the job with ctrl-z and then use bg to background it. Log out, log in and ps ax | grep shutdown should show that it's still running.

              – Jared Beck
              Feb 13 '13 at 1:18



















            -1














            I suggest this command in your cron:



            dbus-send --system --print-reply --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend


            This does not need root.






            share|improve this answer

























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "89"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f83685%2fscheduling-startup-and-shutdown%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              7 Answers
              7






              active

              oldest

              votes








              7 Answers
              7






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              19














              For a one-time shutdown you can use



              shutdown -h 02:00


              To schedule it you can use cron. There are some GUIs for it like gnome-schedule.



              But to start machine on schedule you have to look at BIOS/UEFI settings.



              Update: check the answers about MythTV and Wake on Plan below to schedule startup.






              share|improve this answer





















              • 1





                This question may be useful: How do I schedule waking up from hibernation?

                – Alba Mendez
                May 17 '12 at 10:17


















              19














              For a one-time shutdown you can use



              shutdown -h 02:00


              To schedule it you can use cron. There are some GUIs for it like gnome-schedule.



              But to start machine on schedule you have to look at BIOS/UEFI settings.



              Update: check the answers about MythTV and Wake on Plan below to schedule startup.






              share|improve this answer





















              • 1





                This question may be useful: How do I schedule waking up from hibernation?

                – Alba Mendez
                May 17 '12 at 10:17
















              19












              19








              19







              For a one-time shutdown you can use



              shutdown -h 02:00


              To schedule it you can use cron. There are some GUIs for it like gnome-schedule.



              But to start machine on schedule you have to look at BIOS/UEFI settings.



              Update: check the answers about MythTV and Wake on Plan below to schedule startup.






              share|improve this answer















              For a one-time shutdown you can use



              shutdown -h 02:00


              To schedule it you can use cron. There are some GUIs for it like gnome-schedule.



              But to start machine on schedule you have to look at BIOS/UEFI settings.



              Update: check the answers about MythTV and Wake on Plan below to schedule startup.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Jan 20 '13 at 6:10

























              answered Nov 29 '11 at 9:03









              int_uaint_ua

              4,256751111




              4,256751111








              • 1





                This question may be useful: How do I schedule waking up from hibernation?

                – Alba Mendez
                May 17 '12 at 10:17
















              • 1





                This question may be useful: How do I schedule waking up from hibernation?

                – Alba Mendez
                May 17 '12 at 10:17










              1




              1





              This question may be useful: How do I schedule waking up from hibernation?

              – Alba Mendez
              May 17 '12 at 10:17







              This question may be useful: How do I schedule waking up from hibernation?

              – Alba Mendez
              May 17 '12 at 10:17















              12














              MythTV is able to shut down computer when it's no longer in use and wake it up a few minutes before the next recording starts. It does it by using ACPI functions to set wakeup time before shutting down. There is an extensive howto on configuring this, which basically boils down to:



              First verify that your Linux kernel is 2.6.22 or newer and the HWclock update function has been disabled as described above.



              Simple test to wake the machine 5 minutes from now



              sudo sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm"
              sudo sh -c "echo `date '+%s' -d '+ 5 minutes'` > /sys/class/rtc/rtc0/wakealarm"
              cat /sys/class/rtc/rtc0/wakealarm


              Check



              cat /proc/driver/rtc


              This should return a list of parameters. Check the "alrm_time" is 5 minutes into the future and the "alrm_date" is today.



              Shutdown your computer and see if it comes back up in ~5 min.



              sudo shutdown -h now  


              (in Ubuntu 10.4 "sudo shutdown -P now" (-h may cause system to restart))



              Of course, if you always need to shut the computer down at the same time and wake it up at the same time, you can just configure wake-up time in bios (if there's such an option) and schedule a shutdown right from init scripts






              share|improve this answer
























              • Great, didn't know about it. Should alrm_pending be 'yes' if alarm is set?

                – int_ua
                Nov 29 '11 at 11:37











              • On my machine alarm_pending is "no" even after I set the wake-up time using the script above. The machine wakes up perfectly though so I think this parameter means something else

                – Sergey
                Nov 29 '11 at 21:26
















              12














              MythTV is able to shut down computer when it's no longer in use and wake it up a few minutes before the next recording starts. It does it by using ACPI functions to set wakeup time before shutting down. There is an extensive howto on configuring this, which basically boils down to:



              First verify that your Linux kernel is 2.6.22 or newer and the HWclock update function has been disabled as described above.



              Simple test to wake the machine 5 minutes from now



              sudo sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm"
              sudo sh -c "echo `date '+%s' -d '+ 5 minutes'` > /sys/class/rtc/rtc0/wakealarm"
              cat /sys/class/rtc/rtc0/wakealarm


              Check



              cat /proc/driver/rtc


              This should return a list of parameters. Check the "alrm_time" is 5 minutes into the future and the "alrm_date" is today.



              Shutdown your computer and see if it comes back up in ~5 min.



              sudo shutdown -h now  


              (in Ubuntu 10.4 "sudo shutdown -P now" (-h may cause system to restart))



              Of course, if you always need to shut the computer down at the same time and wake it up at the same time, you can just configure wake-up time in bios (if there's such an option) and schedule a shutdown right from init scripts






              share|improve this answer
























              • Great, didn't know about it. Should alrm_pending be 'yes' if alarm is set?

                – int_ua
                Nov 29 '11 at 11:37











              • On my machine alarm_pending is "no" even after I set the wake-up time using the script above. The machine wakes up perfectly though so I think this parameter means something else

                – Sergey
                Nov 29 '11 at 21:26














              12












              12








              12







              MythTV is able to shut down computer when it's no longer in use and wake it up a few minutes before the next recording starts. It does it by using ACPI functions to set wakeup time before shutting down. There is an extensive howto on configuring this, which basically boils down to:



              First verify that your Linux kernel is 2.6.22 or newer and the HWclock update function has been disabled as described above.



              Simple test to wake the machine 5 minutes from now



              sudo sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm"
              sudo sh -c "echo `date '+%s' -d '+ 5 minutes'` > /sys/class/rtc/rtc0/wakealarm"
              cat /sys/class/rtc/rtc0/wakealarm


              Check



              cat /proc/driver/rtc


              This should return a list of parameters. Check the "alrm_time" is 5 minutes into the future and the "alrm_date" is today.



              Shutdown your computer and see if it comes back up in ~5 min.



              sudo shutdown -h now  


              (in Ubuntu 10.4 "sudo shutdown -P now" (-h may cause system to restart))



              Of course, if you always need to shut the computer down at the same time and wake it up at the same time, you can just configure wake-up time in bios (if there's such an option) and schedule a shutdown right from init scripts






              share|improve this answer













              MythTV is able to shut down computer when it's no longer in use and wake it up a few minutes before the next recording starts. It does it by using ACPI functions to set wakeup time before shutting down. There is an extensive howto on configuring this, which basically boils down to:



              First verify that your Linux kernel is 2.6.22 or newer and the HWclock update function has been disabled as described above.



              Simple test to wake the machine 5 minutes from now



              sudo sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm"
              sudo sh -c "echo `date '+%s' -d '+ 5 minutes'` > /sys/class/rtc/rtc0/wakealarm"
              cat /sys/class/rtc/rtc0/wakealarm


              Check



              cat /proc/driver/rtc


              This should return a list of parameters. Check the "alrm_time" is 5 minutes into the future and the "alrm_date" is today.



              Shutdown your computer and see if it comes back up in ~5 min.



              sudo shutdown -h now  


              (in Ubuntu 10.4 "sudo shutdown -P now" (-h may cause system to restart))



              Of course, if you always need to shut the computer down at the same time and wake it up at the same time, you can just configure wake-up time in bios (if there's such an option) and schedule a shutdown right from init scripts







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Nov 29 '11 at 10:59









              SergeySergey

              36.4k98799




              36.4k98799













              • Great, didn't know about it. Should alrm_pending be 'yes' if alarm is set?

                – int_ua
                Nov 29 '11 at 11:37











              • On my machine alarm_pending is "no" even after I set the wake-up time using the script above. The machine wakes up perfectly though so I think this parameter means something else

                – Sergey
                Nov 29 '11 at 21:26



















              • Great, didn't know about it. Should alrm_pending be 'yes' if alarm is set?

                – int_ua
                Nov 29 '11 at 11:37











              • On my machine alarm_pending is "no" even after I set the wake-up time using the script above. The machine wakes up perfectly though so I think this parameter means something else

                – Sergey
                Nov 29 '11 at 21:26

















              Great, didn't know about it. Should alrm_pending be 'yes' if alarm is set?

              – int_ua
              Nov 29 '11 at 11:37





              Great, didn't know about it. Should alrm_pending be 'yes' if alarm is set?

              – int_ua
              Nov 29 '11 at 11:37













              On my machine alarm_pending is "no" even after I set the wake-up time using the script above. The machine wakes up perfectly though so I think this parameter means something else

              – Sergey
              Nov 29 '11 at 21:26





              On my machine alarm_pending is "no" even after I set the wake-up time using the script above. The machine wakes up perfectly though so I think this parameter means something else

              – Sergey
              Nov 29 '11 at 21:26











              6














              I've written an application to schedule startup, it's called Wake on Plan.



              It's not available in the official repository yet (review pending) but you can start using it from PPA:



              https://launchpad.net/~xintx-ua/+archive/wakeonplan



              2014-2015 Update:



              I've created the QML version with Ubuntu SDK using phone as a target and hoping for easy porting to desktop over a year ago. But click packages were never ready for use on desktop and now I'm waiting until snappy packages will be. Please notify me when they are. Right now even snappy list -uv crashed on my 15.04x64 installation and it doesn't look ready at all. Or you can try building a deb packages yourself, I'll try to help as much as I can.






              share|improve this answer





















              • 1





                I've tried it (January 18th, 2013) and it works well under 12.10 — though there is no "Quantal" package. Is it under active development?

                – Ed Villegas
                Jan 19 '13 at 14:42











              • Thanks for the info :) Not really active as it's still wasn't approved due to one empty folder in the package that I can't find how to get rid of, check here: askubuntu.com/questions/221701

                – int_ua
                Jan 20 '13 at 6:05











              • And Quickly 12.08.x intended for usage under 12.10 breaks a lot, so I first wanted to finish the 12.04 version.

                – int_ua
                Jan 20 '13 at 6:08











              • Good luck and thanks for sharing your work!

                – Ed Villegas
                Jan 20 '13 at 6:49






              • 1





                Does this still work? If so, could you build packages for more recent Ubuntu versions please? :)

                – Seth
                Jul 12 '15 at 18:10
















              6














              I've written an application to schedule startup, it's called Wake on Plan.



              It's not available in the official repository yet (review pending) but you can start using it from PPA:



              https://launchpad.net/~xintx-ua/+archive/wakeonplan



              2014-2015 Update:



              I've created the QML version with Ubuntu SDK using phone as a target and hoping for easy porting to desktop over a year ago. But click packages were never ready for use on desktop and now I'm waiting until snappy packages will be. Please notify me when they are. Right now even snappy list -uv crashed on my 15.04x64 installation and it doesn't look ready at all. Or you can try building a deb packages yourself, I'll try to help as much as I can.






              share|improve this answer





















              • 1





                I've tried it (January 18th, 2013) and it works well under 12.10 — though there is no "Quantal" package. Is it under active development?

                – Ed Villegas
                Jan 19 '13 at 14:42











              • Thanks for the info :) Not really active as it's still wasn't approved due to one empty folder in the package that I can't find how to get rid of, check here: askubuntu.com/questions/221701

                – int_ua
                Jan 20 '13 at 6:05











              • And Quickly 12.08.x intended for usage under 12.10 breaks a lot, so I first wanted to finish the 12.04 version.

                – int_ua
                Jan 20 '13 at 6:08











              • Good luck and thanks for sharing your work!

                – Ed Villegas
                Jan 20 '13 at 6:49






              • 1





                Does this still work? If so, could you build packages for more recent Ubuntu versions please? :)

                – Seth
                Jul 12 '15 at 18:10














              6












              6








              6







              I've written an application to schedule startup, it's called Wake on Plan.



              It's not available in the official repository yet (review pending) but you can start using it from PPA:



              https://launchpad.net/~xintx-ua/+archive/wakeonplan



              2014-2015 Update:



              I've created the QML version with Ubuntu SDK using phone as a target and hoping for easy porting to desktop over a year ago. But click packages were never ready for use on desktop and now I'm waiting until snappy packages will be. Please notify me when they are. Right now even snappy list -uv crashed on my 15.04x64 installation and it doesn't look ready at all. Or you can try building a deb packages yourself, I'll try to help as much as I can.






              share|improve this answer















              I've written an application to schedule startup, it's called Wake on Plan.



              It's not available in the official repository yet (review pending) but you can start using it from PPA:



              https://launchpad.net/~xintx-ua/+archive/wakeonplan



              2014-2015 Update:



              I've created the QML version with Ubuntu SDK using phone as a target and hoping for easy porting to desktop over a year ago. But click packages were never ready for use on desktop and now I'm waiting until snappy packages will be. Please notify me when they are. Right now even snappy list -uv crashed on my 15.04x64 installation and it doesn't look ready at all. Or you can try building a deb packages yourself, I'll try to help as much as I can.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Aug 26 '15 at 23:33

























              answered Jul 13 '12 at 13:39









              int_uaint_ua

              4,256751111




              4,256751111








              • 1





                I've tried it (January 18th, 2013) and it works well under 12.10 — though there is no "Quantal" package. Is it under active development?

                – Ed Villegas
                Jan 19 '13 at 14:42











              • Thanks for the info :) Not really active as it's still wasn't approved due to one empty folder in the package that I can't find how to get rid of, check here: askubuntu.com/questions/221701

                – int_ua
                Jan 20 '13 at 6:05











              • And Quickly 12.08.x intended for usage under 12.10 breaks a lot, so I first wanted to finish the 12.04 version.

                – int_ua
                Jan 20 '13 at 6:08











              • Good luck and thanks for sharing your work!

                – Ed Villegas
                Jan 20 '13 at 6:49






              • 1





                Does this still work? If so, could you build packages for more recent Ubuntu versions please? :)

                – Seth
                Jul 12 '15 at 18:10














              • 1





                I've tried it (January 18th, 2013) and it works well under 12.10 — though there is no "Quantal" package. Is it under active development?

                – Ed Villegas
                Jan 19 '13 at 14:42











              • Thanks for the info :) Not really active as it's still wasn't approved due to one empty folder in the package that I can't find how to get rid of, check here: askubuntu.com/questions/221701

                – int_ua
                Jan 20 '13 at 6:05











              • And Quickly 12.08.x intended for usage under 12.10 breaks a lot, so I first wanted to finish the 12.04 version.

                – int_ua
                Jan 20 '13 at 6:08











              • Good luck and thanks for sharing your work!

                – Ed Villegas
                Jan 20 '13 at 6:49






              • 1





                Does this still work? If so, could you build packages for more recent Ubuntu versions please? :)

                – Seth
                Jul 12 '15 at 18:10








              1




              1





              I've tried it (January 18th, 2013) and it works well under 12.10 — though there is no "Quantal" package. Is it under active development?

              – Ed Villegas
              Jan 19 '13 at 14:42





              I've tried it (January 18th, 2013) and it works well under 12.10 — though there is no "Quantal" package. Is it under active development?

              – Ed Villegas
              Jan 19 '13 at 14:42













              Thanks for the info :) Not really active as it's still wasn't approved due to one empty folder in the package that I can't find how to get rid of, check here: askubuntu.com/questions/221701

              – int_ua
              Jan 20 '13 at 6:05





              Thanks for the info :) Not really active as it's still wasn't approved due to one empty folder in the package that I can't find how to get rid of, check here: askubuntu.com/questions/221701

              – int_ua
              Jan 20 '13 at 6:05













              And Quickly 12.08.x intended for usage under 12.10 breaks a lot, so I first wanted to finish the 12.04 version.

              – int_ua
              Jan 20 '13 at 6:08





              And Quickly 12.08.x intended for usage under 12.10 breaks a lot, so I first wanted to finish the 12.04 version.

              – int_ua
              Jan 20 '13 at 6:08













              Good luck and thanks for sharing your work!

              – Ed Villegas
              Jan 20 '13 at 6:49





              Good luck and thanks for sharing your work!

              – Ed Villegas
              Jan 20 '13 at 6:49




              1




              1





              Does this still work? If so, could you build packages for more recent Ubuntu versions please? :)

              – Seth
              Jul 12 '15 at 18:10





              Does this still work? If so, could you build packages for more recent Ubuntu versions please? :)

              – Seth
              Jul 12 '15 at 18:10











              3














              Use cronjob to auto shootdown and auto power on. The command below will shutdown the computer at 02.00 AM and start the machine 4 hours later (14400 seconds)



              00 2 * * * root /usr/sbin/rtcwake -m off -s 14400





              share|improve this answer
























              • This seems like the simplest solution. Thank you!

                – mpen
                Jul 29 '17 at 5:27
















              3














              Use cronjob to auto shootdown and auto power on. The command below will shutdown the computer at 02.00 AM and start the machine 4 hours later (14400 seconds)



              00 2 * * * root /usr/sbin/rtcwake -m off -s 14400





              share|improve this answer
























              • This seems like the simplest solution. Thank you!

                – mpen
                Jul 29 '17 at 5:27














              3












              3








              3







              Use cronjob to auto shootdown and auto power on. The command below will shutdown the computer at 02.00 AM and start the machine 4 hours later (14400 seconds)



              00 2 * * * root /usr/sbin/rtcwake -m off -s 14400





              share|improve this answer













              Use cronjob to auto shootdown and auto power on. The command below will shutdown the computer at 02.00 AM and start the machine 4 hours later (14400 seconds)



              00 2 * * * root /usr/sbin/rtcwake -m off -s 14400






              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Jul 27 '17 at 5:36









              Jom32yJom32y

              311




              311













              • This seems like the simplest solution. Thank you!

                – mpen
                Jul 29 '17 at 5:27



















              • This seems like the simplest solution. Thank you!

                – mpen
                Jul 29 '17 at 5:27

















              This seems like the simplest solution. Thank you!

              – mpen
              Jul 29 '17 at 5:27





              This seems like the simplest solution. Thank you!

              – mpen
              Jul 29 '17 at 5:27











              1














              I'm using an older Ubuntu 10.04.4 LTS system, and I have had some success with the rtcwake command. Use it like this on the command line:



              # wake the system in 1 Hour:
              sudo rtcwake -s 3600 -m disk


              The -m disk option should put it in a low-power state, and depending on hardware support (i.e.: your own computer), you might even be able to successfully use -m off to fully power off.



              Also, you can put the above into the /etc/crontab to schedule it automatically every day.






              share|improve this answer




























                1














                I'm using an older Ubuntu 10.04.4 LTS system, and I have had some success with the rtcwake command. Use it like this on the command line:



                # wake the system in 1 Hour:
                sudo rtcwake -s 3600 -m disk


                The -m disk option should put it in a low-power state, and depending on hardware support (i.e.: your own computer), you might even be able to successfully use -m off to fully power off.



                Also, you can put the above into the /etc/crontab to schedule it automatically every day.






                share|improve this answer


























                  1












                  1








                  1







                  I'm using an older Ubuntu 10.04.4 LTS system, and I have had some success with the rtcwake command. Use it like this on the command line:



                  # wake the system in 1 Hour:
                  sudo rtcwake -s 3600 -m disk


                  The -m disk option should put it in a low-power state, and depending on hardware support (i.e.: your own computer), you might even be able to successfully use -m off to fully power off.



                  Also, you can put the above into the /etc/crontab to schedule it automatically every day.






                  share|improve this answer













                  I'm using an older Ubuntu 10.04.4 LTS system, and I have had some success with the rtcwake command. Use it like this on the command line:



                  # wake the system in 1 Hour:
                  sudo rtcwake -s 3600 -m disk


                  The -m disk option should put it in a low-power state, and depending on hardware support (i.e.: your own computer), you might even be able to successfully use -m off to fully power off.



                  Also, you can put the above into the /etc/crontab to schedule it automatically every day.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered May 17 '14 at 16:27









                  Ogre Psalm33Ogre Psalm33

                  1113




                  1113























                      0














                      You can use shutdown command to schedule a shutdown. To shutdown at 2 AM you can use the following command:



                      sudo shutdown -h 2:00


                      You will need to run this command in terminal and leave the terminal open.



                      Regarding startup, I dont think that it is possible for Ubuntu or any app running on it to switch on a computer. You will need hardware assistance for this for example you can use Wake on Lan.






                      share|improve this answer
























                      • Regarding startup - you're correct in a very narrow technical sense (because Ubuntu is not running when a computer is down), but with a bit of trickery it is possible to schedule a wakeup from a program/script. :)

                        – Sergey
                        Nov 29 '11 at 11:02











                      • I don't think you need to keep the terminal open. You can stop the job with ctrl-z and then use bg to background it. Log out, log in and ps ax | grep shutdown should show that it's still running.

                        – Jared Beck
                        Feb 13 '13 at 1:18
















                      0














                      You can use shutdown command to schedule a shutdown. To shutdown at 2 AM you can use the following command:



                      sudo shutdown -h 2:00


                      You will need to run this command in terminal and leave the terminal open.



                      Regarding startup, I dont think that it is possible for Ubuntu or any app running on it to switch on a computer. You will need hardware assistance for this for example you can use Wake on Lan.






                      share|improve this answer
























                      • Regarding startup - you're correct in a very narrow technical sense (because Ubuntu is not running when a computer is down), but with a bit of trickery it is possible to schedule a wakeup from a program/script. :)

                        – Sergey
                        Nov 29 '11 at 11:02











                      • I don't think you need to keep the terminal open. You can stop the job with ctrl-z and then use bg to background it. Log out, log in and ps ax | grep shutdown should show that it's still running.

                        – Jared Beck
                        Feb 13 '13 at 1:18














                      0












                      0








                      0







                      You can use shutdown command to schedule a shutdown. To shutdown at 2 AM you can use the following command:



                      sudo shutdown -h 2:00


                      You will need to run this command in terminal and leave the terminal open.



                      Regarding startup, I dont think that it is possible for Ubuntu or any app running on it to switch on a computer. You will need hardware assistance for this for example you can use Wake on Lan.






                      share|improve this answer













                      You can use shutdown command to schedule a shutdown. To shutdown at 2 AM you can use the following command:



                      sudo shutdown -h 2:00


                      You will need to run this command in terminal and leave the terminal open.



                      Regarding startup, I dont think that it is possible for Ubuntu or any app running on it to switch on a computer. You will need hardware assistance for this for example you can use Wake on Lan.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Nov 29 '11 at 9:05









                      binWbinW

                      9,43863962




                      9,43863962













                      • Regarding startup - you're correct in a very narrow technical sense (because Ubuntu is not running when a computer is down), but with a bit of trickery it is possible to schedule a wakeup from a program/script. :)

                        – Sergey
                        Nov 29 '11 at 11:02











                      • I don't think you need to keep the terminal open. You can stop the job with ctrl-z and then use bg to background it. Log out, log in and ps ax | grep shutdown should show that it's still running.

                        – Jared Beck
                        Feb 13 '13 at 1:18



















                      • Regarding startup - you're correct in a very narrow technical sense (because Ubuntu is not running when a computer is down), but with a bit of trickery it is possible to schedule a wakeup from a program/script. :)

                        – Sergey
                        Nov 29 '11 at 11:02











                      • I don't think you need to keep the terminal open. You can stop the job with ctrl-z and then use bg to background it. Log out, log in and ps ax | grep shutdown should show that it's still running.

                        – Jared Beck
                        Feb 13 '13 at 1:18

















                      Regarding startup - you're correct in a very narrow technical sense (because Ubuntu is not running when a computer is down), but with a bit of trickery it is possible to schedule a wakeup from a program/script. :)

                      – Sergey
                      Nov 29 '11 at 11:02





                      Regarding startup - you're correct in a very narrow technical sense (because Ubuntu is not running when a computer is down), but with a bit of trickery it is possible to schedule a wakeup from a program/script. :)

                      – Sergey
                      Nov 29 '11 at 11:02













                      I don't think you need to keep the terminal open. You can stop the job with ctrl-z and then use bg to background it. Log out, log in and ps ax | grep shutdown should show that it's still running.

                      – Jared Beck
                      Feb 13 '13 at 1:18





                      I don't think you need to keep the terminal open. You can stop the job with ctrl-z and then use bg to background it. Log out, log in and ps ax | grep shutdown should show that it's still running.

                      – Jared Beck
                      Feb 13 '13 at 1:18











                      -1














                      I suggest this command in your cron:



                      dbus-send --system --print-reply --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend


                      This does not need root.






                      share|improve this answer






























                        -1














                        I suggest this command in your cron:



                        dbus-send --system --print-reply --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend


                        This does not need root.






                        share|improve this answer




























                          -1












                          -1








                          -1







                          I suggest this command in your cron:



                          dbus-send --system --print-reply --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend


                          This does not need root.






                          share|improve this answer















                          I suggest this command in your cron:



                          dbus-send --system --print-reply --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend


                          This does not need root.







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Feb 16 '13 at 14:15









                          Eric Carvalho

                          41.7k17115147




                          41.7k17115147










                          answered Feb 16 '13 at 13:55









                          eexpresseexpress

                          366




                          366






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Ask Ubuntu!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f83685%2fscheduling-startup-and-shutdown%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              How to change which sound is reproduced for terminal bell?

                              Can I use Tabulator js library in my java Spring + Thymeleaf project?

                              Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents