Automatic deletion of recordings possible in OpenBh 5.0?

pcfe

Member
Hello,

switching from an DM900 with the dreambox image to a Vu+ with OpenBh 5.0, I wonder if it includes an option to automatically delete recordings after N days?

Why?
for recordings like the eight 'o clock news, I record to a custom location (/media/hdd/movie/autoclean/), now normally I just clean out news after 3 days with a primitive shell script and a systemd timer[1] and then follow up with cleanup.py, but I figured I'd ask if maybe OpenBH 5.0 has that functionality already and I just fail to find it.

pcfe
[1] While that old post of mine is in German, the shell output is hopefully self explanatory.
 

pcfe

Member
for what it's worth; currently I am using the following, but I am definitely open to suggestions, especially if there is a setting in E2 I just fail to find.

Bash:
#!/bin/bash
# make subdirs in /media/hdd/movie/
#   /media/hdd/movie/autoclean
#   /media/hdd/movie/keep (remember to set this as your default Enignma2 recording path)
#
# This script is meant to remove recordings after a set amount of days by using the
# find command with the delete flag. So it should contain lines like the following:
# /usr/bin/find  /media/hdd/movie/autoclean -maxdepth 1 -mtime +2 -name "*Das Erste HD - Tagesschau*" -print -delete
#
# The idea is that e.g. news recorded every day are really only interesting for a couple days,
# so one might as well delete them after two days.

date
echo disk space before cleaning
df -h /media/hdd/movie/autoclean

echo "finding and deleting specific shows whose recordings are older than 2 days"
/usr/bin/find /media/hdd/movie/autoclean -maxdepth 1 -mtime +2 -name "*Das Erste HD - Tagesschau*" -print -delete
/usr/bin/find /media/hdd/movie/autoclean -maxdepth 1 -mtime +2 -name "*Das Erste HD - Tagesthemen*" -print -delete
/usr/bin/find /media/hdd/movie/autoclean -maxdepth 1 -mtime +2 -name "*Das Erste HD - Nachtmagazin*" -print -delete
/usr/bin/find /media/hdd/movie/autoclean -maxdepth 1 -mtime +2 -name "*Das Erste HD - Weltspiegel*" -print -delete
/usr/bin/find /media/hdd/movie/autoclean -maxdepth 1 -mtime +2 -name "*Das Erste HD - Wetter vor acht*" -print -delete
/usr/bin/find /media/hdd/movie/autoclean -maxdepth 1 -mtime +2 -name "*Das Erste HD - Sportschau*" -print -delete
echo

echo "finding and deleting specific shows whose recordings are older than 7 days"
/usr/bin/find /media/hdd/movie/autoclean -maxdepth 1 -mtime +7 -name "*Formel 1*" -print -delete
/usr/bin/find /media/hdd/movie/autoclean -maxdepth 1 -mtime +7 -name "*Eishockey*" -print -delete
echo

echo "finding and deleting specific shows whose recordings are older than 28 days"
/usr/bin/find /media/hdd/movie/autoclean -maxdepth 1 -mtime +28 -name "*Das Erste HD - ttt - titel thesen temperamente*" -print -delete
/usr/bin/find /media/hdd/movie/autoclean -maxdepth 1 -mtime +28 -name "* - extra 3.*" -print -delete
/usr/bin/find /media/hdd/movie/autoclean -maxdepth 1 -mtime +28 -name "* - heute-show.*" -print -delete
echo

echo disk space after cleaning
df -h /media/hdd/movie/autoclean
echo

echo "all done"
date
 

AlexWilMac

Moderator
Staff member
No, there is no automatic deleting of files.
It's quite easy, under OBH, to check if an option is possible: usually, you just need to press MENU while you are in the place you want to customise.
So, after entering the rec list, you can press menu and then the first option is "Settings...". The you can customise, for instance, the coloured keys and many other aspects.
The same, is possible by MENU/Settings/Recording, Playback and Timeshift/Recording & Playback.
 

pcfe

Member
@AlexWilMac thanks for the clarification.

For future readers of this thread; Since cleanup.py was updated yesterday to also support Python 3, I now use the script from comment #2 with the following added near the end:
Bash:
echo "running cleanup.py from https://github.com/jbretsch/pvrutils"
# Keep 100GiB free in .../autoclean
/home/root/bin/cleanup.py -s 102400 /media/hdd/movie/autoclean

It is entered in Menu / Timers / Cron Timers as Daily 19:15

pcfe
 
Top