[mythtv-users] Is there a way (via Myth or mysql) to list recording rules with an active user job?

Stephen Worthington stephen_agent at jsw.gen.nz
Fri Nov 29 03:48:33 UTC 2013


On Thu, 28 Nov 2013 15:40:48 -0500, you wrote:

>A while back I had a user job that was run on every recording. I've since
>changed that user job slot to be used by mythvidexport.py .
>
>However...
>
>Some of my recording rules (some of which may only be triggered once a
>year) have the user job (#3) still active, but of course know it's trying
>to automatically run mythvidexport.py on them...which is something I don't
>want.
>
>Is there a way to list all the recording rules which have an active User
>Job #3 so I can then go into those rules and turn it off?
>
>Thanks.

WARNING: Backup your database before messing around with it!  If you
do not already know how to do that and to restore it again, you
probably should not be using SQL commands.

This SQL should show all the jobs with user job 3 enabled:

  select recordid,type,chanid,starttime,title,autouserjob3 from record
where autouserjob3!=0;

And this should turn off all user job 3s:

  update record set autouserjob3=0 where autouserjob3!=0;


And to log in to the mythconverg database on my Mythbuntu 12.04
system, I use this script (do_mythconverg.sh), run from root or using
sudo:

#!/bin/bash

# Run MySQL to access the mythconverg database.

#source /etc/mythtv/mysql.txt

which xmlstarlet >/dev/null
if [ $? != 0 ] ; then
    echo 'Error: xmlstarlet is not installed.'
    echo 'On Ubuntu, you can use the command "sudo apt-get install
xmlstarlet" to install it.'
    exit 1
fi

configxml=/etc/mythtv/config.xml

DBUserName=`xmlstarlet sel -t -v
Configuration/UPnP/MythFrontend/DefaultBackend/DBUserName $configxml`
if [ "$DBUserName" == "" ]; then
    # Either config.xml does not exist, or it is in MythTV 0.26 or
greater
    # format.  Try 0.26+ format.

    DBUserName=`xmlstarlet sel -t -v Configuration/Database/UserName
$configxml`
    if [ "$DBPassword" == "" ]; then
	echo "Error: Either $configxml does not exist or it is in an
unknown format."
	exit 1
    fi

    DBPassword=`xmlstarlet sel -t -v Configuration/Database/Password
$configxml`
    DBHostName=`xmlstarlet sel -t -v Configuration/Database/Host
$configxml`
    DBName=`xmlstarlet sel -t -v Configuration/Database/DatabaseName
$configxml`
else
    # The config.xml file is in 0.25 and before format.

    DBPassword=`xmlstarlet sel -t -v
Configuration/UPnP/MythFrontend/DefaultBackend/DBPassword $configxml`
    DBHostName=`xmlstarlet sel -t -v
Configuration/UPnP/MythFrontend/DefaultBackend/DBHostName $configxml`
    DBName=`xmlstarlet sel -t -v
Configuration/UPnP/MythFrontend/DefaultBackend/DBName $configxml`
fi

mysql -u $DBUserName -p$DBPassword -h $DBHostName $DBName

The email software may have word wrapped this file, so watch for
wrapped lines, or you can download it from my web site on:

  http://www.jsw.gen.nz/mythtv/do_mythconverg.sh


More information about the mythtv-users mailing list