<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 1, 2023 at 11:02 PM Stephen Worthington <<a href="mailto:stephen_agent@jsw.gen.nz">stephen_agent@jsw.gen.nz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, 1 Nov 2023 16:43:59 -0400, you wrote:<br>
<br>
>Running 33.1 fixes<br>
><br>
>I'm running out of space until I get a new drive for the mythbox, so<br>
>mounted a windows share and set up a user job using the script at:<br>
><br>
><a href="https://www.mythtv.org/wiki/Myth_archive_job.pl" rel="noreferrer" target="_blank">https://www.mythtv.org/wiki/Myth_archive_job.pl</a><br>
><br>
>I had used this in the past on another system and it worked. All it does is<br>
>move the recording file if there's enough space. I chose a recording and<br>
>selected the user job. It failed.<br>
><br>
>The backend log:<br>
>Nov  1 14:40:46 bhmf mythbackend: mythbackend[210595]: E UserJob_920<br>
>jobqueue.cpp:2468 (DoUserJobThread) JobQueue: User Job '/usr/bin/<br>
><a href="http://myth_archive_job.pl" rel="noreferrer" target="_blank">myth_archive_job.pl</a> -d /media/disk2/mythtv -f 15709_20231031235900.ts"'<br>
>failed.<br>
><br>
>When I ran /usr/bin/<a href="http://myth_archive_job.pl" rel="noreferrer" target="_blank">myth_archive_job.pl</a> -d /media/disk2/mythtv -f<br>
>15709_20231031235900.ts from the command line as the mythtv user it worked.<br>
><br>
>Any idea why it would fail as a user job? How can I get some more info on<br>
>why it failed?<br>
><br>
>Thanks.<br>
<br>
User jobs get run by mythbackend, and so are run using the same user<br>
as mythbackend.  Jobs run from the command line are run as the user<br>
used to log on that command line.  So they are likely different users<br>
with different ownership and permissions on directories.  So what are<br>
the ownership and permissions on your archive directories?  Are they<br>
in the mythtv group?<br>
<br>
There is actually no need to run a script like Myth_archive_job.pl to<br>
move recording files - you can use any normal tool like mv from the<br>
command line or a GUI tool.  As long as you do it when MythTV is not<br>
in use (not recording or playing a recording and not within 1 minute<br>
of a recording start time), it is safe to move recording files.  You<br>
should have your archive directories in a storage group so that MythTV<br>
can still find the recordings in them - I just created a storage group<br>
called "Archives" and put mine in that.  Then as long as you do not<br>
have any recording rules that specifically say to record to any of the<br>
"Archives" directories, mythbackend will not record there but will<br>
find the files for playback and deletion.<br>
<br>
I have written myself a Python program (mythsqu) that has an option to<br>
fill up my "Archives" partitions from my recording partitions.  It<br>
moves the recordings oldest first, and monitors MythTV's state so it<br>
will pause whenever MythTV is busy.  Then when that has run (or when I<br>
have added a new or larger recording drive), I also run my<br>
balance_storage.sh script that moves recordings between my recording<br>
drives until they have roughly equal free space.  This is very useful<br>
when I replace an old 4 Tbyte drive with a new 20 Tbyte one, so that<br>
the free space is spread around and mythbackend will record evenly<br>
across my seven recording drives.  The balance_storage.sh script is<br>
older and only monitors MythTV's status for upcoming recordings - as<br>
soon as one is within 5 minutes it stops, so you need to run it again<br>
later when MythTV is idle again.<br>
<br>
<a href="http://www.jsw.gen.nz/mythtv/mythsgu" rel="noreferrer" target="_blank">http://www.jsw.gen.nz/mythtv/mythsgu</a><br>
<a href="http://www.jsw.gen.nz/mythtv/balance_storage.sh" rel="noreferrer" target="_blank">http://www.jsw.gen.nz/mythtv/balance_storage.sh</a><br>
<br>
I would suggest that the simplest thing for you to do would be to wait<br>
for MythTV to be idle, then use a GUI file management program that can<br>
sort by timestamp to select the oldest files in each of your recording<br>
directories and move them to the Windows drive.  Then run<br>
balance_storage.sh.  When you get your new drive, you can just add it<br>
to your normal "Default" storage group and move all the files from the<br>
Windows drive over to it, then run balance_storage.sh again.<br></blockquote><div><br></div><div>That's the weird part. The backend runs as mythtv, I ran the successful command line test as the mythtv user. And the windows share is mounted as mythtv owner and group. Per the wiki (<a href="https://www.mythtv.org/wiki/Setup_Storage_Directories">https://www.mythtv.org/wiki/Setup_Storage_Directories</a>) the permissions are 2755.<br></div><div><br></div><div>I'll take your advice and check out your scripts. Thanks.</div><div><br></div><div>BTW,  you mentioned that you had 7 -recording- drives...what case are you using?<br></div></div></div>