[mythtv-users] Record, flag commercials, then move to NAS

Marco Quezada mellamanjefe at gmail.com
Sat Feb 11 03:14:04 UTC 2012


On Feb 10, 2012 9:56 PM, "John Drescher" <drescherjm at gmail.com> wrote:
>
> On Fri, Feb 10, 2012 at 4:55 PM, Marco Quezada <mellamanjefe at gmail.com>
wrote:
> >>> I was not aware that myth would search through all the listed
> >>> directories in storage groups to look for recordings, that is great
> >>> design and helps me understand a little better how to take advantage
> >>> of them. So correct me if I'm wrong but I if I create a user job
> >>> (simple script) to run after the commercial flagging that copies the
> >>> flagged show to the NAS I should get what I need, right? (as long as I
> >>> set up the storage groups correctly).
> >>>
> >
> >>Exactly.
> >>
> >>Having 2 Storage Groups allows you to specify that MythTV should only
> >>record to the local dirs (in the Default group), but MythTV will still
> >>find the recordings after you move them to non-local dirs in another
group.
> >>
> >>However, you will want to remember to remove the original file after you
> >>copy it over.  I'm pretty sure you know that, but just wanted to say it
> >>explicitly since you said, "copies."
> >>
> >>Also, note that if you fill up the local directories, MythTV will begin
> >>to expire recordings from those directories--and not from the remote
> >>directories--since it's only allowed to write to the local directories.
> >>Note, though, that the same would hold true even if all the directories
> >>are in the recording (Default) storage group.  So, just make sure you
> >>have a sufficiently large local file system to handle the recordings
> >>until you've gotten them moved.
> >
> >>Mike
> >
> > Great, yes I move the files but thanks for clarifying that they should
> > be removed afterwards.
> > If it helps others, here is what my entry in the backend settings
> > looks like for user job #1:
> >
> > /usr/local/bin/moveFlaggedRecording.sh %DIR% %FILE%
/data/mythtv/recordings
> >
> > And the very simple script (moveFlaggedRecordings.sh) looks like so:
> >
> > #!/bin/sh
> >
> > SRCDIR=$1
> > SRCFILE=$2
> > DESTDIR=$3
> >
> > #Only move the file if it is not already in the destination
> >
> > if [ ! -f $DESTDIR/$SRCFILE ]; then
> >   # move the file and associated snaphots
> >   mv $SRCDIR/$SRCFILE* $DESTDIR/
> > fi
> >
> >
> >
> > Now I am tackling a scheduler issue...
> >
>
> How about rsync with the --remove-source-files parameter?
>
> This will verify that the files are the same and then delete the file
> from the sending side.
> John
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://www.mythtv.org/mailman/listinfo/mythtv-users

Thanks, I will look into the rsync command. I would like to mention that in
the script I posted above that the mount point for the destination is at
/data so that as mentioned earlier the move will fail if the directory is
not mounted. Also, the script adds the slashes to the path in case they
were not specified when the script was called. I will also look into the
ionice and size allocation.

-Marco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.mythtv.org/pipermail/mythtv-users/attachments/20120210/5f734c91/attachment.html 


More information about the mythtv-users mailing list