Too Many Files in the Temp Directory - Change the Backup Directory for a Manual Backup
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Atlassian recommends disabling the XML backup both for performance and reliability. Setting up a test server and the Production Backup Strategy is better done with an SQL dump. Upgrading Confluence is better done without the XML backup.
The one operation for which an XML backup is required is database migration. For this we recommend a commercial database migration tool. Vote for Too Many Files in the Temp Directory - Change the Backup Directory for a Manual Backup to add a more robust strategy for large implementation migrations. Atlassian does not support migrating to a new database.
Symptoms
- The daily backup has been changed to a different folder for daily backups, but the manual backup is still going to the home directory.
- The size of the
<confluence-home>/temp
directory is large
Cause
The location for daily backups folder is different from the folder where a manual backup is generated. The change made to the daily-backup folder does not apply to the folder where manual backups are created.
Resolution
Edit the following line in the
<confluence-home>/confluence.cfg.xml
file:<property name="webwork.multipart.saveDir">${confluenceHome}/temp</property>
Despite the name, this property is used for all temporary files in Confluence, not just multipart file uploads.
Additionally, you can configure the periodic deletion of temporary files by Confluence. On the Scheduled Jobs administration page, you can adjust the schedule for the "Clean Temporary Directory" job. By default, it runs at 4am server time each day.
The job deletes files which are themselves older than 24 hours, so by default, files can remain in the temporary directory for just shy of 48 hours. For downloadable files generated and managed by Confluence, this matches with the "download gatekeeper" policy, which allows access to generated files for 24 hours after their creation.