marzzzello / mpv_thumbnail_script

A Lua script to show preview thumbnails in mpv's OSC seekbar, sans external dependencies (fork)
GNU General Public License v3.0
278 stars 20 forks source link

Delete thumbnail #6

Closed zwb124 closed 2 years ago

zwb124 commented 3 years ago

You can add a script to automatically delete the thumbnails of a few days ago, thanks!

marzzzello commented 2 years ago

What about using find as cronjob? Example:

# delete thumbnails created before one hour:
find /tmp/my_mpv_thumbnails -mmin +60 -exec rm -r '{}' +
# delete thumbnails created before one day:
find /tmp/my_mpv_thumbnails -mtime +1 -exec rm -r '{}' +

# delete thumbnails accessed before one hour:
find /tmp/my_mpv_thumbnails -amin +60 -exec rm -r '{}' +
# delete thumbnails accessed before one day:
find /tmp/my_mpv_thumbnails -atime +1 -exec rm -r '{}' +

To run it hourly by cron put the line you want into crontab -e:

# mm hh DD MM W cmd
   0  *  *  * * find [...]

make sure your cron service runs (eg. systemctl status cronie.service)

zwb124 commented 2 years ago

thanks