use the new code in ffmpeg-myth.scm to cull old files
This commit is contained in:
parent
3cb6c612e3
commit
d88a8b9e9e
@ -1,20 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -aex
|
set -aex
|
||||||
recordingsdir=${recordingsdir:-"/var/lib/mythtv/recordings/"}
|
|
||||||
rm=${rm:-"/bin/rm -f"}
|
|
||||||
cutoff=$(date --date='-2 weeks' +%s)
|
|
||||||
echo cutoff is $cutoff
|
|
||||||
|
|
||||||
cd "$recordingsdir"
|
/usr/local/bin/ffmpeg-myth.scm myth-clean-recordings-update-deleted-ltbtranscodedtobedeleted # 1 '"echo "' '(lambda(x) x)'
|
||||||
cleanables=$(for f in *mkv; do ls ${f/.mkv/}.{ts,mpg,ts.png,mpg.png} 2>/dev/null; done | sed 's/\n/ /g;')
|
exit 0
|
||||||
|
|
||||||
d=0
|
|
||||||
for f in ${cleanables}; do
|
|
||||||
Z=$(stat --format="%Z" $f)
|
|
||||||
if test $Z -lt $cutoff; then
|
|
||||||
$rm $f
|
|
||||||
d=$((d+1))
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo Deleted $d files. Done.
|
|
||||||
|
Loading…
Reference in New Issue
Block a user