Tools
Remove old logs and backups files from WHD Virtual Appliance
This article provides instructions on how to configure the WHD Virtual Appliance (VA) to automatically remove log and backup files older than 14 days .
First published date
Last published date
Overview
This article provides instructions on how to configure the WHD Virtual Appliance (VA) to automatically remove log and backup files older than 14 days.
Product section
Resolution
- Log in via SSH to the Virtual Appliance/Linux box.
- Switch to user root with sudo su.
- In the command line, type the command crontab -e to open the cron job editor.
- Press the A key to enter into edit mode.
- Copy and paste the following:
#***************** Minute (0-60)
# #*************** Hour (0-23)
# # #************* Day of Month (1-31)
# # # #*********** Month (1-12)
# # # # #********* Day of Week (0-6)
# # # # #
0 3 * * * find /usr/local/webhelpdesk/bin/tomcat/logs -mtime +14 -exec rm {} \;
0 3 * * * find /usr/local/webhelpdesk/log/ -mtime +14 -exec rm {} \;
0 3 * * * find /usr/local/webhelpdesk/pgsql9/backups/ -mtime +14 -exec rm {} \; - Press ESC and press SHIFT + ZZ to save the cron job.