Introduction
Roundcube stores temporary files within the cPanel user's home directory by default which typically looks like this:
/home/cpanelusername/tmp
By default Roundcube's temporary files are configured to be expired and removed after 48 hours.
The /usr/local/cpanel/scripts/upcp
script is run via the root user's crontab each night. In addition to installing any updates, the upcp script also runs the maintenance script which is the actual script that cleans the expired files: /usr/local/cpanel/scripts/maintenance
This default expiry time of 48 hours is typically suitable, however the following procedure explains how you may alter this configuration if needed.
Procedure
- Login to the server via SSH or Terminal as the root user
- Create a backup of the existing configuration with the following command:
cp -v /usr/local/cpanel/base/3rdparty/roundcube/config/config.inc.php{,$(date +.%Y-%b-%d-%H-%M-%S)}
- Open
/usr/local/cpanel/base/3rdparty/roundcube/config/config.inc.php
with the text editor of your choice. - Locate the following line:
$config['temp_dir_ttl'] = '48h';
- Update it to a time period that is suitable for you.
- If there are Roundcube temporary files that are past the expiry time that you have just configured, you may manually run the maintenance script to remove them:
/usr/local/cpanel/scripts/maintenance | tee /root/cPanel-Manual-Maintenance-$(date +.%Y-%b-%d-%H-%M-%S)