[mythtv-users] Powersaving

Brian Long briandlong at gmail.com
Thu Jun 16 12:48:48 UTC 2011


On Thu, Jun 16, 2011 at 8:25 AM, Per Kofod <per.s.kofod at gmail.com> wrote:
> Hi
>
> I am new to using mythtv, and is currently running it on my desktop PC while
> waiting for the parts for building a HTPC.
>
> I have managed to set mythtv up so shut down automaticaly when not busy, and
> set the bios time to restart the the computer in time for the next
> recording, all very well. I used the method described on this page:
>
> http://www.mythtv.org/wiki/ACPI_Wakeup
>
> I would however like to take this one step further, as I would like to
> make sure,  that if shutdown is executed, I would like to have a script, that will
> check if  mythbackend is busy and not shut down if that is the case, or if mythbackend
> is not busy, set the wakeup time, if a later recording is scheduled.
>
> So my question is:
>
> 1: Does mythtv have a command, that will tell if the backend is busy?
> 2: Does mythtv have a command, that will return the time of the next
> recording? (or 0 if none).

Per, you should be using mythshutdown to determine if/when to shutdown.

mythshutdown -h
Usage of mythshutdown
-w/--setwakeup time      (sets the wakeup time. time=yyyy-MM-ddThh:mm:ss
                          doesn't write it into nvram)
-t/--setscheduledwakeup  (sets the wakeup time to the next scheduled recording)
-q/--shutdown            (set nvram-wakeup time and shutdown)
-x/--safeshutdown        (equal to -c -t -q.  check shutdown possible, set
                           scheduled wakeup and shutdown)
-p/--startup             (check startup. check will return 0 if automatic
                                                           1 for manually)
-c/--check flag          (check shutdown possible
                          flag is 0 - don't check recording status
                                  1 - do check recording status (default)
                          returns 0 ok to shutdown
                                  1 reset idle check)
-l/--lock                (disable shutdown. check will return 1.)
-u/--unlock              (enable shutdown. check will return 0)
-s/--status flag         (returns a code indicating the current status)
                          flag is 0 - don't check recording status
                                  1 - do check recording status (default)
                          0 - Idle
                          1 - Transcoding
                          2 - Commercial Detection
                          4 - Grabbing EPG data
                          8 - Recording - only valid if flag is 1
                         16 - Locked
                         32 - Jobs running or pending
                         64 - In a daily wakeup/shutdown period
                        128 - Less than 15 minutes to next wakeup period
                        255 - Setup is running
-v/--verbose debug-level (Use '-v help' for level info
-h/--help                (shows this usage)

/Brian/


More information about the mythtv-users mailing list