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

John Drescher drescherjm at gmail.com
Sat Feb 11 02:56:18 UTC 2012

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).
>>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.
> 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
> #Only move the file if it is not already in the destination
> if [ ! -f $DESTDIR/$SRCFILE ]; then
>   # move the file and associated snaphots
> 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.

More information about the mythtv-users mailing list