Ticket Attachment Pruning

From WHMCS Documentation

Revision as of 07:54, 19 July 2019 by Matt (talk | contribs) (Created page with "==Introduction== The prune ticket attachments feature automatically deletes and purges ticket attachments following a set amount of time of inactivity following closure of a...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.

  1. Begin by navigating to Utilities > System > System Cleanup within the Admin Area
  2. Locate the 'Prune Ticket Attachments' option
  3. Select the desired date to prune tickets from
  4. Click the Delete button.
Note: Attachment Pruning is performed in batches of 1,000 ticket attachments at a time. If the number of attachments to be pruned for the time period you select exceeds this, you will receive a notice indicating that the first 1,000 have been pruned but that there are additional attachments remaining. In this scenario, you will need to repeat the process until the system no longer advises you there are remaining attachments.

Automatic Pruning

WHMCS can be configured to perform automated pruning of ticket attachments.

To do this, follow the steps below.

  1. Begin by navigating to Setup > Automation Settings within the Admin Area
  2. Confirm your admin password if prompted
  3. Locate the Prune Ticket Attachments setting under the Support Ticket Settings heading
  4. 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.
  5. After making your selection, click Save Changes at the bottom of the page
Automatic Ticket Pruning is performed hourly by the System Cron. Learn more...

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:

php crons/cron.php -vvv do --AutoPruneTicketAttachments

You can configure the above command to run as frequently as you wish, but we recommend no more frequently than every 5 minutes.