Hello
Nothing to do with OpnSense! But maybe some nerds could help
i have a vm with jellyfin watching movies i have e directory filling up with some *.ts files.
until the older are deleted by the system or the disk run full.
is there a command to
find in a directory the oldest not used file and only keep the newest 10 or 20 files?
have a nice day
vinc
man find
OK, maybe a post should consist of more then 8 characters :-)
delete all files in DIR (and subdirs!) matching '*.ts' older then 30 days
find /my/directory/to/clean/up/ -type f -name '*.ts' -mtime 30 -exec rm -v {} \;
if you just want to keep the newest 20 and all are in one directory you can even use ls
cd /my/directory/to/clean/up/; rm $(ls -1t *.ts | head -20)