[mythtvnz] Deleting files
Stephen Worthington
stephen_agent at jsw.gen.nz
Tue Sep 17 04:02:47 BST 2013
On 17/09/2013 11:23 a.m., Worik Stanton wrote:
> Having run out of disk space I am trying to recover some room.
>
> I delete files using mythweb but I get no improvement in my disc.
> Deleting an 8GB file does not free up *GB.
Note: I am using MythTV 0.26 on Mythbuntu 12.04.
Mythbackend will normally automatically delete recordings to make
enough space for new recordings. It checks regularly for enough space
on the drive(s) it is writing new recordings to and deletes files as
necessary. There are quite a few settings for how this works. Go to
Setup > Video > General > (2nd page) General (Auto-Expire). At the
bottom of that page there is a setting "Time to retain deleted
recordings (days)". Set that to 0. Also review the other auto-expire
settings on that page.
The default auto-expire method is "Lowest priority first", so if you
have channel priorities set or have set priorities in your recording
rules, those same priorities will be applied when auto-expiring.
Auto-expire only works if you have your recordings set to auto-expire.
Go to Manage Recordings > Recording Rules and select a rule at random
and hit Enter. Go down to Storage Options and hit Enter. Does the
rule have an X in the box at the bottom of the list beside "Allow
recordings to expire?". If so, that rule will create recordings that
will auto-expire. Go down to the rule "Default (Template)" and check
it too. That rule is the rule used to create the default settings for
any new rule (although you can also create your own templates).
Then go to Media Library > Watch Recordings. On that screen, each
program that is auto-expireable will normally have (depending on the
theme used), a marker displayed showing the auto-expiable status. I
use MythCenter-wide 1.7, and in that there are a series of icons that
can be displayed at the bottom right. For an auto-expireable program,
I see a little yellow tombstone displayed with the letters "RIP" in
it.
Go to Information Centre > System Status > and then along the tabs to
the right to AutoExpire List. On my system, it is initially
off-screen and will only display when you get to it. This screen
displays the list of all the recording files on your system, in the
order they will be deleted by auto-expire. If you have any files that
have already been marked for deletion but have not actually been
deleted yet, they will be at the top of the list, marked as
"(Deleted)". If you want to delete them immediately, use the down
arrow key to go down onto the list, then hit the D key or Enter (or OK
on your remote) and select Delete Now. That will then queue the file
for actual deletion, but it can still take a little while for
mythbackend to do the deletion after that, depending on the settings
and how busy it is.
Note that the AutoExpire List does not show which recording partition
a file is in - when mythbackend needs room, it will auto-expire the
next recording on this list that is in the same recording partition as
it wants to record in.
If you are OK with SQL, this query:
select chanid,starttime,title from recorded where deletepending=0;
will show you any recordings queued for actual deletion that have not
been deleted yet.
If you want the channel names displayed, use this query:
select chanid,(select name from channel c where
c.chanid=r.chanid),starttime,title from recorded r where
deletepending=1;
If there are lots of recordings with deletepending=1, then you
probably have a permissions problem, and mythbackend will be logging
messages all the time about problems deleting the files. In a
terminal, go to one of your storage group recording directories and do
an "ls -alt | head -n 20" command to see your latest recordings there,
and also "ls -alt | tail -n 20" to see the oldest ones. They should
look something like this:
root at mypvr:/mnt/rec1/recordings# ls -alt | head -n 20
total 3490329316
-rw-r--r-- 1 mythtv mythtv 192733088 Sep 17 14:41
4088_20130917023400.mpg
drwxrwxrwx 2 root root 36864 Sep 17 14:34 .
-rw-rw-rw- 1 mythtv mythtv 73475 Sep 17 13:41
4088_20130917004400.mpg.png
-rw-r--r-- 1 mythtv mythtv 1327011348 Sep 17 13:41
4088_20130917004400.mpg
-rw-rw-rw- 1 mythtv mythtv 62890 Sep 17 06:22
4060_20130916172400.mpg.png
-rw-r--r-- 1 mythtv mythtv 1366703788 Sep 17 06:22
4060_20130916172400.mpg
-rw-rw-rw- 1 mythtv mythtv 85071 Sep 17 01:19
4095_20130916042900.mpg.png
-rw-rw-rw- 1 mythtv mythtv 69356 Sep 16 19:04
1003_20130916055900.mpg.png
-rw-r--r-- 1 mythtv mythtv 5269674780 Sep 16 19:04
1003_20130916055900.mpg
-rw-r--r-- 1 mythtv mythtv 1766933792 Sep 16 17:31
4095_20130916042900.mpg
-rw-rw-rw- 1 mythtv mythtv 64915 Sep 16 02:23
4045_20130914230400.mpg.png
-rw-rw-rw- 1 mythtv mythtv 65571 Sep 15 20:33
1003_20130915055900.mpg.png
-rw-r--r-- 1 mythtv mythtv 5269752800 Sep 15 19:04
1003_20130915055900.mpg
-rw-rw-rw- 1 mythtv mythtv 106624 Sep 15 18:33
4088_20130914153400.mpg.png
-rw-r--r-- 1 mythtv mythtv 672060144 Sep 15 11:39
4045_20130914230400.mpg
-rw-rw-rw- 1 mythtv mythtv 101178 Sep 15 06:35
4088_20130914181900.mpg.png
-rw-r--r-- 1 mythtv mythtv 388896048 Sep 15 06:33
4088_20130914181900.mpg
-rw-r--r-- 1 mythtv mythtv 846531288 Sep 15 04:04
4088_20130914153400.mpg
-rw-rw-rw- 1 mythtv mythtv 59241 Sep 15 00:35
1002_20130914072900.mpg.png
As you can see, the ownership should be mythtv:mythtv. If there are
any files that are not of that ownership, run "chown mythtv:mythtv *"
to fix this. Check that the owner has "rw" permission (the left hand
three characters for the permissions. If not, then run "chmod u=rw *"
to fix this. Then mythbackend should be able to delete them. Do this
in all your recording directories.
More information about the mythtvnz
mailing list