Difference between revisions of "Mythshutdown"

From MythTV Official Wiki
Jump to: navigation, search
(Added list of Mythshutdown command line options)
(Link to MythShutdown on MythWelcome page)
 
(One intermediate revision by one user not shown)
Line 16: Line 16:
  
  
The full command-line options are (taken from version 0.22 output):
+
The full command-line options are (taken from version 0.25.1 output):
 
{{Code box|mythshutdown --help|<pre>
 
{{Code box|mythshutdown --help|<pre>
-w/--setwakeup time      (sets the wakeup time. time=yyyy-MM-ddThh:mm:ss
+
Misc. Options:
                          doesn't write it into nvram)
+
-c OR --check                Check whether shutdown is possible
-t/--setscheduledwakeup (sets the wakeup time to the next scheduled recording)
+
--lock                        disable shutdown
-q/--shutdown            (set nvram-wakeup time and shutdown)
+
-x OR --safeshutdown          Check if shutdown is possible, and shutdown
-x/--safeshutdown        (equal to -c -t -q. check shutdown possible, set
+
-t OR --setscheduledwakeup   Set wakeup time to the next scheduled recording
                          scheduled wakeup and shutdown)
+
-w OR --setwakeup            Set the wakeup time (yyyy-MM-ddThh:mm:ss)
-p/--startup             (check startup. check will return 0 if automatic
+
-h OR --help OR --usage      Display this help printout, or give detailed information of selected option.
                                                          1 for manually)
+
--version                    Display version information.
-c/--check flag          (check shutdown possible
+
--shutdown                    Apply wakeup time to nvram and shutdown.
                          flag is 0 - don't check recording status
+
-p OR --startup               Check startup status
                                  1 - do check recording status (default)
+
-s OR --status               check current status
                          returns 0 ok to shutdown
+
-u OR --unlock               enable shutdown
                                  1 reset idle check)
+
 
-l/--lock               (disable shutdown. check will return 1.)
+
Logging Options:
-u/--unlock              (enable shutdown. check will return 0)
+
--loglevel                    Set the logging level. All log messages at lower levels will be discarded.
-s/--status flag        (returns a code indicating the current status)
+
                              In descending order: emerg, alert, crit, err, warning, notice, info, debug
                          flag is 0 - don't check recording status
+
                              defaults to info
                                  1 - do check recording status (default)
+
--logpath                    Writes logging messages to a file in the directory logpath with filenames in the format: applicationName.date.pid.log.
                          0 - Idle
+
                              This is typically used in combination with --daemon, and if used in combination with --pidfile, this can be used with log rotators, using the HUP call to inform MythTV to reload the file
                          1 - Transcoding
+
--nodblog                    Disable database logging.
                          2 - Commercial Flagging
+
-q OR --quiet                Don't log to the console (-q).  Don't log anywhere (-q -q)
                          4 - Grabbing EPG data
+
--syslog                      Set the syslog logging facility.
                          8 - Recording - only valid if flag is 1
+
                              Set to "none" to disable, defaults to none.
                        16 - Locked
+
-v OR --verbose               Specify log filtering. Use '-v help' for level info.
                        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)
+
  
 
</pre>}}
 
</pre>}}
  
  
See, also, [[Mythwelcome]].
+
See, [[Mythwelcome]] for more information on using MythShutdown.

Latest revision as of 14:50, 11 July 2012

Incomplete.png Incomplete, needs to be expanded. Please help to fill the gaps or discuss the issue on the talk page

Using Mythshutdown to block shutdown

Mythshutdown can be used to block an automatic shutdown. Since 0.21 it is possible to call mythshutdown --lock from each script so that shutdown will remain blocked until the last script has terminated and called mythshutdown --unlock.


Script.png script.sh
#!/bin/bash
# Unlock if the script is terminated for any reason
trap "/usr/local/bin/mythshutdown --unlock" 0 SIGHUP SIGINT SIGQUIT SIGABRT SIGKILL SIGALRM SIGSEGV SIGTERM

# Lock shutdown
/usr/local/bin/mythshutdown --lock

# Do script stuff


The full command-line options are (taken from version 0.25.1 output):

Script.png mythshutdown --help
Misc. Options:
-c OR --check                 Check whether shutdown is possible
--lock                        disable shutdown
-x OR --safeshutdown          Check if shutdown is possible, and shutdown
-t OR --setscheduledwakeup    Set wakeup time to the next scheduled recording
-w OR --setwakeup             Set the wakeup time (yyyy-MM-ddThh:mm:ss)
-h OR --help OR --usage       Display this help printout, or give detailed information of selected option.
--version                     Display version information.
--shutdown                    Apply wakeup time to nvram and shutdown.
-p OR --startup               Check startup status
-s OR --status                check current status
-u OR --unlock                enable shutdown

Logging Options:
--loglevel                    Set the logging level.  All log messages at lower levels will be discarded.
                              In descending order: emerg, alert, crit, err, warning, notice, info, debug
                              defaults to info
--logpath                     Writes logging messages to a file in the directory logpath with filenames in the format: applicationName.date.pid.log.
                              This is typically used in combination with --daemon, and if used in combination with --pidfile, this can be used with log rotators, using the HUP call to inform MythTV to reload the file
--nodblog                     Disable database logging.
-q OR --quiet                 Don't log to the console (-q).  Don't log anywhere (-q -q)
--syslog                      Set the syslog logging facility.
                              Set to "none" to disable, defaults to none.
-v OR --verbose               Specify log filtering. Use '-v help' for level info.



See, Mythwelcome for more information on using MythShutdown.