myth deletes recording files that I symlink

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
mjurgens
Newcomer
Posts: 11
Joined: Sun Jul 12, 2020 5:13 am
Australia

myth deletes recording files that I symlink

Post by mjurgens »

Let me run through the specific case. What I am trying to do here is record on fast SSD storage and later move the files to slower HDD storage.

I have one storage directory (/var/tmp/mythtv) in the default storage group.
I record some shows. Now I have files in /var/tmp/mythtv. Two days later I decide I want to move the actual files to /archive and symlink the file to this location. So I do this
mv /var/tmp/mythtv/file1.ts /archive
ln -s /archive/file1.ts /var/tmp/mythtv/file1.ts

now the file is /var/tmp/mythtv/file1.ts is a symlink but points to the real file /archive/file1.ts

Within minutes myth deletes the symlink and the recording from its DB.

What is going on here? Is it even possible to make this work (record on fast storage, and store later on slower, larger storage)?
blm-ubunet
Senior
Posts: 265
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: myth deletes recording files that I symlink

Post by blm-ubunet »

How does the symlink do anything?
Your archive folder would need read only access.

Use storage groups & always write into a folder in the mountpoint target.
"archive" is a type of storage group.
Make the slow long term storage folder be included in storage group of type archive.

I believe there is a setting to indicate/allow following symlinks.. but that will just make the files disappear.
User avatar
pgbennett
Developer
Posts: 503
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: myth deletes recording files that I symlink

Post by pgbennett »

Probably the same reason as for the other question. /var/tmp/mythtv may be short of space and it thinks by deleting the files it will get space in there. Clearly it is best not to symlink files in this way.
mjurgens
Newcomer
Posts: 11
Joined: Sun Jul 12, 2020 5:13 am
Australia

Re: myth deletes recording files that I symlink

Post by mjurgens »

You beat me to it. Yes, this is the same reason. I will still be managing my files in this way but effectively disabling myth's auto deletion process by configuring it to only trigger when there is near zero space available. I will manage/monitor the diskspace outside of myth.
blm-ubunet
Senior
Posts: 265
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: myth deletes recording files that I symlink

Post by blm-ubunet »

I have a shingled 8TB drive in an archive storage group.
I record to a 2TB HDD. After 6 months of aging , files are just moved to HDD folder that is in the archive storage group.

AFAIUI The archive storage group allows manual deleting but no auto-deletion.
Post Reply