Views:

To initiate a daily cron job:

  1. Create and name a file called "clean_recyclebin" in /etc/cron.d/:

    root@appliance1:~# sudo vim /etc/cron.d/clean_recyclebin

  2. Copy the example codes into the file and save it.
  3. 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.

    SHELL=/bin/sh
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

    # m h dom mon dow user command
    0 16 * * * root /opt/TrendMicro/OSDP/Bin/cron/trimUserData.pl recyclebin --maxdays 30 --nodup cleanuprecyclebin

Comments (0)