Skip to content

Automatic Delete Leak Files (Crontab)

xbdm edited this page Sep 15, 2023 · 1 revision

Delete leaked Send upload files older than 7 days (and a bit) every hour

0 * * * * find /usr/share/nginx/send/uploads/ -mmin +10130 -exec rm {} ;

Uploads have their lifetime in days prefixed, so you can be a little bit smarter with cleaning up:

0 * * * * find /usr/share/nginx/send/uploads/ -name 7-* -mmin +10130 -exec rm {} ; 0 * * * * find /usr/share/nginx/send/uploads/ -name 1-* -mmin +1500 -exec rm {} ;