[mythtv-users] HDHR + Over the Air + Sony Network Media Player + Buffalo NAS

Jeff Tucker jefftucker at gmail.com
Wed Dec 21 04:21:16 UTC 2011

On Fri, Dec 16, 2011 at 11:38 AM, Craig Treleaven <ctreleaven at cogeco.ca>

At 10:53 AM -0600 12/16/11, Jeremy Jones wrote:

On Thu, Dec 15, 2011 at 9:54 PM, Jeff Tucker <jefftucker at gmail.com> wrote: 


So basically I recorded a TV episode and once it completed its recording I
ran mythlink.pl to create the organized/readable links. MiniDLNA is running
so I assumed that it would have updated itself with the newest


Yes, you can set up a user job to run mythlink for that recording only.  I
also have a cron job setup to run mythlink nightly, so that I can clean up
the links to deleted recordings.


[...] The cron job is necessary though, otherwise you will end up with a
bunch of links to files that don't exist.


Minor point, but my strategy is to refresh ALL the links every time a
recording ends.  Only takes a few seconds and I've never seen any noticeable
impact on either backend or frontend activities on that machine.  Maybe if
you have multiple hundreds of recordings, it would be different.



Craig is right.  What I should have said was:

You can't just run mythlink as a user job inputting the recording to add.
At some point you will need to run it with a full rescan.   I originally had
my system setup that way, but after re-looking at it, I am not running that
userjob at all.   I guess after a while I just forgot about ticking the
userjob to run mithlink, and I just didn't realize it because I always had a
backlog. What is happening is that the cron job runs nightly and it executes
this script:



/usr/share/doc/mythtv-backend/contrib/user_jobs/mythlink.pl --link
/2TB_HDD_1/videos/recordedTV --underscore --format %T/%oY-%om-%od_%S



I suppose one could execute that same script as a user job and refresh them
all at once.  I also have this script that I wrote back when I was first
setting everything up. It runs mythlink via the script above and then waits
a given time before restarting minidlna.  One problem I had was that
minidlna needed to run as root.  Anyway, the script is below.  Hope some of
this helps.






#/usr/share/doc/mythtv-backend/contrib/user_jobs/mythlink.pl --link
/2TB_HDD_1/videos/mythtv --underscore --format %T/%T%-%S%-%Y-%m-%d


echo -n 'Creating Symbolic links for Recorded TV  - Wait:  '

# Give mythlink time to finish




until [ $timeToWait -lt 1 ];do

#  echo

#  echo  "the backspaces should be: ${#timeToWait}"

##  echo "The time will be: $timeToWait"

  echo -n "$timeToWait"

  sleep $cycleTime

  # echo ${#timeToWait}

  while [ $strlen -gt 0 ];do

    echo -ne "\b"

    echo -ne " "

    echo -ne "\b"

    let strlen=strlen-=1


  #if [ $timeToWait -lt 11 ] ; then

  #  echo -ne " "


  let timeToWait=timeToWait-=$cycleTime

  let strlen=${#timeToWait}


#echo $strlen




#restart minidlna and force a rescan

gksudo /etc/init.d/minidlna restart





I have created the cronjob similar to what you have given me however
minidlna doesn't correctly update/rescan the links created from mythtvlink.
When I try to view the recordings from the media player it doesn't have any
information. I basically lost the linked folders and .mpg files in minidlna,
they still exist in the link from mythtvlink.


Two things happened: I created the cronjob and it started running every 30
minutes. I deleted some old recordings using MythWeb and then all of a
sudden I couldn't see the recordings that were left.


I tried uninstalling and re-installing minidlna but that didn't do anything
to help matters.


I have even tried to force-restart minidlna but it didn't clear anything up.


I was reading about gksudo and sudo and wonder if I should be using sudo
since gksudo is only for opening GUI applications without having to use a
terminal session. IE. from an icon on the workspace/desktop.


Please pass along anything you think might help me recover my minidlna


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.mythtv.org/pipermail/mythtv-users/attachments/20111220/54a3877c/attachment.html 

More information about the mythtv-users mailing list