Ticket Attachment Pruning
Introduction
The prune ticket attachments feature automatically deletes and purges ticket attachments following a set amount of time of inactivity following closure of a ticket.
This provides security benefits by only storing files for the shortest amount of time necessary and helps reduce disk storage requirements needed for file attachments.
When attachment pruning occurs, file attachments are removed from the configured storage location for attachments (at the time of writing either local disk or Amazon S3 Compatible storage provider). Following removal of attachments, when viewing a ticket, both admin and client users will still be able to view a list of attachment filenames, but they will be annotated with a notice indicating that they have been removed due to inactivity in the ticket. There is no way to recover file attachments that have been pruned.
One-Off Pruning
You can perform a one-off on-demand prune of ticket attachments via the System Cleanup tools.
To do this, follow the steps below.
- Begin by navigating to Utilities > System > System Cleanup within the Admin Area
- Locate the 'Prune Ticket Attachments' option
- Select the desired date to prune tickets from
- Click the Delete button.
Automatic Pruning
WHMCS can be configured to perform automated pruning of ticket attachments.
To do this, follow the steps below.
- Begin by navigating to Setup > Automation Settings within the Admin Area
- Confirm your admin password if prompted
- Locate the Prune Ticket Attachments setting under the Support Ticket Settings heading
- In the dropdown, choose the number of months you wish attachments to be retained for following closure of a ticket. Note that the minimum length of time for attachments to be retained for is 1 month.
- After making your selection, click Save Changes at the bottom of the page
Batch Processing
As noted above, Attachment Pruning is performed in batches of 1,000 ticket attachments at a time.
Following enabling of the Automatic Attachment Pruning, if the number of attachments to be pruned exceeds this number, it may take several runs for all attachments matching the selected criteria to be removed.
For large installations with a high volume of ticket attachments, you may wish to run the Ticket Attachment Pruning task more frequently than hourly. This can be done by configuring a cron command as follows:
You can configure the above command to run as frequently as you wish, but we recommend no more frequently than every 5 minutes.