This article shows how to automatically clean up the Recycle Bin regularly.
To initiate a daily cron job:
- Create and name a file called "clean_recyclebin" in /etc/cron.d/:
root@appliance1:~# sudo vim /etc/cron.d/clean_recyclebin
- Copy the example codes into the file and save it.
- You can modify the "maxdays" parameter to update the maximum days before trimming files. In this example, the parameter has been set to 30 days.
You can delete all the files in recycle-bin folder immediately by setting maxdays to 0. (i.e. --maxdays 0). You can also re-schedule it to run the job at a specific time you want. In this example, it will run at 16:00 UTC everyday:
# A daily job to clean recycle_bin periodically.
# m h dom mon dow user command
0 16 * * * root /opt/TrendMicro/OSDP/Bin/cron/trimUserData.pl recyclebin --maxdays 30 --nodup cleanuprecyclebin