Difference between revisions of "Ticket Attachment Pruning"

From WHMCS Documentation

(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...")
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Introduction==
+
Pruning ticket attachments automatically deletes and purges ticket attachments following a set length of inactivity after 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 for file attachments.
  
The prune ticket attachments feature automatically deletes and purges ticket attachments following a set amount of time of inactivity following closure of a ticket.
+
Attachment pruning removes file attachments from the configured storage location for attachments (local disk or an Amazon S3™-compatible storage provider). After removal of attachments, when viewing a ticket, both admins and clients can view a list of attachment filenames. The system will annotate the filenames with a notice indicating their removal due to inactivity in the ticket. You cannot recover pruned ticket attachments.
 
 
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==
 
==One-Off Pruning==
  
You can perform a one-off on-demand prune of ticket attachments via the ''System Cleanup'' tools.
+
You can perform a one-time on-demand prune of ticket attachments using the tools at '''Utilities > System > [[System Cleanup]]'''.
  
To do this, follow the steps below.
+
To do this.
  
# Begin by navigating to ''Utilities > System > System Cleanup'' within the Admin Area
+
# Go to '''Utilities > System > [[System Cleanup]]'''.
# Locate the 'Prune Ticket Attachments' option
+
# For '''Prune Ticket Attachments''', select the desired date to prune tickets from.
# Select the desired date to prune tickets from
+
# Click '''Delete'''.
# Click the ''Delete'' button.
 
  
<div class="docs-alert-warning">'''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.</div>
+
<div class="docs-alert-warning">
 +
The system prunes attachments in batches of 1,000 ticket attachments per batch. If the number of attachments to prune for the time period you select exceeds this, you will receive a notice that the system successfully pruned the first 1,000 but that there are additional attachments remaining. In this scenario, you must repeat the process until the system no longer advises you there are remaining attachments.
 +
</div>
  
 
==Automatic Pruning==
 
==Automatic Pruning==
  
WHMCS can be configured to perform automated pruning of ticket attachments.
+
You can configure WHMCS to perform automated ticket attachment pruning.
  
To do this, follow the steps below.
+
To do this:
  
# Begin by navigating to ''Setup > Automation Settings'' within the Admin Area
+
# Go to '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > System Settings > [[Automation Settings]]''' or, prior to WHMCS 8.0, '''Setup > Automation Settings'''.
# Confirm your admin password if prompted
+
# If the system requests it, confirm your admin password.
# Locate the ''Prune Ticket Attachments'' setting under the ''Support Ticket Settings'' heading
+
# For '''Prune Ticket Attachments''' under '''Support Ticket Settings''', choose the number of months to retain attachments following closure of a ticket (minimum one month).
# 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.
+
# Click '''Save Changes'''.
# After making your selection, click ''Save Changes'' at the bottom of the page
 
  
<div class="docs-alert-info">Automatic Ticket Pruning is performed hourly by the System Cron. [[Crons|Learn more...]]</div>
+
<div class="docs-alert-info">
 +
The [[Crons|system cron]] performs automatic ticket pruning every hour.
 +
</div>
  
 
===Batch Processing===
 
===Batch Processing===
  
As noted above, Attachment Pruning is performed in batches of 1,000 ticket attachments at a time.
+
If you enable automatic attachment pruning and the number of attachments to prune exceeds 1,000 (the number in each pruning batch), it may take several runs to remove all of the attachments that match the selected criteria.
 
 
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:
+
For large installations with a high volume of ticket attachments, you can run the ticket attachment pruning task more frequently than hourly. To do this, configure the following cron command:
  
 
<div class="source-cli">php crons/cron.php -vvv do --AutoPruneTicketAttachments</div>
 
<div class="source-cli">php crons/cron.php -vvv do --AutoPruneTicketAttachments</div>
  
You can configure the above command to run as frequently as you wish, but we recommend no more frequently than every 5 minutes.
+
You can configure this command to run as frequently as you wish, but we recommend no more than every 5 minutes.

Latest revision as of 18:42, 9 May 2022

Pruning ticket attachments automatically deletes and purges ticket attachments following a set length of inactivity after 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 for file attachments.

Attachment pruning removes file attachments from the configured storage location for attachments (local disk or an Amazon S3™-compatible storage provider). After removal of attachments, when viewing a ticket, both admins and clients can view a list of attachment filenames. The system will annotate the filenames with a notice indicating their removal due to inactivity in the ticket. You cannot recover pruned ticket attachments.

One-Off Pruning

You can perform a one-time on-demand prune of ticket attachments using the tools at Utilities > System > System Cleanup.

To do this.

  1. Go to Utilities > System > System Cleanup.
  2. For Prune Ticket Attachments, select the desired date to prune tickets from.
  3. Click Delete.

The system prunes attachments in batches of 1,000 ticket attachments per batch. If the number of attachments to prune for the time period you select exceeds this, you will receive a notice that the system successfully pruned the first 1,000 but that there are additional attachments remaining. In this scenario, you must repeat the process until the system no longer advises you there are remaining attachments.

Automatic Pruning

You can configure WHMCS to perform automated ticket attachment pruning.

To do this:

  1. Go to Configuration () > System Settings > Automation Settings or, prior to WHMCS 8.0, Setup > Automation Settings.
  2. If the system requests it, confirm your admin password.
  3. For Prune Ticket Attachments under Support Ticket Settings, choose the number of months to retain attachments following closure of a ticket (minimum one month).
  4. Click Save Changes.

The system cron performs automatic ticket pruning every hour.

Batch Processing

If you enable automatic attachment pruning and the number of attachments to prune exceeds 1,000 (the number in each pruning batch), it may take several runs to remove all of the attachments that match the selected criteria.

For large installations with a high volume of ticket attachments, you can run the ticket attachment pruning task more frequently than hourly. To do this, configure the following cron command:

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

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