[mythtv-users] mythlink User Job Help

Michael T. Dean mtdean at thirdcontact.com
Mon Jan 14 17:16:47 UTC 2013


On 01/13/2013 05:43 PM, Michael T. Dean wrote:
> On 01/13/2013 03:55 PM, Mark Gardner wrote:
>> Hello,
>>
>> Can anyone please help me understand why command 1 works from the
>> command line but command 2 (modified with chanid and starttime) does not
>> run when set as a User Job?
>>
>> 1 - /usr/share/doc/mythtv-backend/contrib/user_jobs/mythlink.pl --link
>> /home/mark/MythRecs --format '\%T/\%T-\%Y\%m\%d-\%H\%i-\%S-\%cN'
>>
>> 2 - /usr/share/doc/mythtv-backend/contrib/user_jobs/mythlink.pl --link
>> /home/mark/MythRecs --chanid %CHANID% --starttime %STARTTIME% --format
>> '\%T/\%T-\%Y\%m\%d-\%H\%i-\%S-\%cN'
>>
>> Is there somewhere I can look (log file) to find out why its not
>> working?
>>
>
> Escaping is very difficult to get right--and hard-coding commands into 
> User Jobs makes it hard to modify/enhance those commands.  My 
> recommendation is to create a script that runs the appropriate 
> mythlink.pl command(s).  See, for example, what I do:
>
> http://www.gossamer-threads.com/lists/mythtv/users/531841#531841

As for logging, add some:

echo $?

(to get return status of commands) as well as some redirects:

LOG_FILE=`mktemp -t mythlink_XXXXXXX.log`

/usr/share/doc/mythtv-backend/contrib/user_jobs/mythlink.pl --link 
/home/mark/MythRecs --chanid %CHANID% --starttime %STARTTIME% --format 
'\%T/\%T-\%Y\%m\%d-\%H\%i-\%S-\%cN' 2>&1 | tee -a ${LOGFILE}

to the script (where the above would write data to some file, like 
/tmp/mythlink_yYiE5gU.log ).

Mike


More information about the mythtv-users mailing list