Opened 18 years ago
Closed 17 years ago
#2363 closed enhancement (fixed)
new contrib script: validate recorded db table versus files stored in recording directories
Reported by: | Owned by: | Robert Kulagowski | |
---|---|---|---|
Priority: | minor | Milestone: | 0.21 |
Component: | mythtv | Version: | |
Severity: | low | Keywords: | |
Cc: | Ticket locked: | no |
Description
The attached script is intended to be part of the contrib/ directory scripts.
The intent of this script is to be able to find orphaned rows in the 'recorded' table (entries which don't have matching files). Likewise it is useful to find orphaned files (potentially taking up gigabytes of otherwise usable space) which have no matching row in the 'recorded' db table.
By default, running the script will simply return a list of problems it finds. Running with --dodbdelete will remove db recorded rows for which there is no matching media file. running with --dodelete will delete media files for which there is no matching db record.
I found this useful to fix up some orphaned db entries (causes mythweb to run verrry slow) as well as reclaim some disk space from some orphaned media files. (not sure what caused these yet, am going to see if they keep recurring)
Attachments (4)
Change History (13)
Changed 18 years ago by
Attachment: | check_recordings.pl added |
---|
comment:1 Changed 18 years ago by
Severity: | medium → low |
---|
comment:2 Changed 18 years ago by
You may want to include some descriptive text about what "unknown", "valid recording", etc, means because while the descriptive text in this ticket is fine, the program needs to stand alone if it's in contrib/
Also, did you add whitespace on purpose around the following?
...35 unknown files using 27.8GB not fixed, check ...
There's extra spaces infront/behind "27.8GB"
comment:3 Changed 18 years ago by
Owner: | changed from Isaac Richards to Robert Kulagowski |
---|
comment:4 Changed 18 years ago by
agree on comments for what the script does. have added that now. whitespace was just cosmetic (provided better output for list-of-filenames). but i digress, have removed the whitespace.
revised version of script attached (rev 0.20). so you had some orphaned media files & recorded rows also. :)
comment:5 Changed 18 years ago by
The status line is very very long and breaks across the right margin; if you can get it to wrap at 72 characters I'll upload it to contrib.
Create a README as well.
comment:6 Changed 18 years ago by
if a transcode is in progress (so there is a CHAN_YYYYMMDDHHMMSS.fmt.tmp) it sees the .tmp as "unknown file" and if --dodelete was enabled would that cause it to delete it? or is unknown different from orphaned files?
comment:7 Changed 18 years ago by
Status: | new → assigned |
---|
comment:8 Changed 17 years ago by
Type: | defect → enhancement |
---|
Does not play nice with storage groups. It doens't find any folders when run without --dirs=. All storage locations need to be specified manualy at the command line.
.png thumbs from mythweb are flagged as unknown files. line 161 cold be? next if ($this_file =~ m/.png/);
I have not checked but, does --dodelete delete w/ rerecord?
Very well done, it'll get a lot of use here.
Changed 17 years ago by
Attachment: | check_recordings.4.pl added |
---|
updated version that handles storage groups
contrib/check_recordings.pl