Difference between revisions of "Mythshutdown"
From MythTV Official Wiki
(Link to MythShutdown on MythWelcome page) |
m (Updated with 0.27.3 command options) |
||
Line 16: | Line 16: | ||
− | The full command-line options are (taken from version 0. | + | The full command-line options are (taken from version 0.27.3 output): |
{{Code box|mythshutdown --help|<pre> | {{Code box|mythshutdown --help|<pre> | ||
Misc. Options: | Misc. Options: | ||
-c OR --check Check whether shutdown is possible | -c OR --check Check whether shutdown is possible | ||
+ | --localtime Specify that the wakeup time is in local time | ||
--lock disable shutdown | --lock disable shutdown | ||
-x OR --safeshutdown Check if shutdown is possible, and shutdown | -x OR --safeshutdown Check if shutdown is possible, and shutdown | ||
-t OR --setscheduledwakeup Set wakeup time to the next scheduled recording | -t OR --setscheduledwakeup Set wakeup time to the next scheduled recording | ||
− | -w OR --setwakeup Set the wakeup time (yyyy-MM-ddThh:mm:ss) | + | -w OR --setwakeup Set the wakeup time (yyyy-MM-ddThh:mm:ss) default is in local time |
-h OR --help OR --usage Display this help printout, or give detailed information of selected option. | -h OR --help OR --usage Display this help printout, or give detailed information of selected option. | ||
--version Display version information. | --version Display version information. | ||
Line 30: | Line 31: | ||
-s OR --status check current status | -s OR --status check current status | ||
-u OR --unlock enable shutdown | -u OR --unlock enable shutdown | ||
+ | --utc Specify that the wakeup time is in utc | ||
Logging Options: | Logging Options: | ||
+ | --enable-dblog Enable logging to database. | ||
--loglevel Set the logging level. All log messages at lower levels will be discarded. | --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 | In descending order: emerg, alert, crit, err, warning, notice, info, debug | ||
− | defaults to | + | defaults to err |
--logpath Writes logging messages to a file in the directory logpath with filenames in the format: applicationName.date.pid.log. | --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 | 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 | ||
− | -- | + | --nologserver Disable all logging but console. |
-q OR --quiet Don't log to the console (-q). Don't log anywhere (-q -q) | -q OR --quiet Don't log to the console (-q). Don't log anywhere (-q -q) | ||
--syslog Set the syslog logging facility. | --syslog Set the syslog logging facility. | ||
Set to "none" to disable, defaults to none. | Set to "none" to disable, defaults to none. | ||
-v OR --verbose Specify log filtering. Use '-v help' for level info. | -v OR --verbose Specify log filtering. Use '-v help' for level info. | ||
− | |||
</pre>}} | </pre>}} |
Revision as of 05:59, 25 September 2014
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.

#!/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.27.3 output):

Misc. Options: -c OR --check Check whether shutdown is possible --localtime Specify that the wakeup time is in local time --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) default is in local time -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 --utc Specify that the wakeup time is in utc Logging Options: --enable-dblog Enable logging to database. --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 err --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 --nologserver Disable all logging but console. -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.