Issue
When a report is executed in Transform with the Publish option turned on, it generates .xlsx files in both the Transform directory and in the C:\Windows\Temp folder on the application server. This can cause the system to run out of storage space over time.
NOTE: In Stewardship Tier 7.4.3 and above, this issue has been resolved and temporary Excel files should no longer accumulate in the C:\Windows\Temp folder.
NOTE: Other components of the Stewardship Tier may also place files in the C:\Windows\Temp folder. These might be .csv, .txt, .xml, or others. This known issue is corrected in the 7.4.1 release. [DSP70-401]
In the meantime, you can resolve the issue by doing one (or both) of the following:
- Solution 1: Change temp file storage location, or
- Solution 2: Remove the temp files.
Solution 1: Change Temp File Storage Location
The temporary file location is specified in the TMP and TEMP system environmental variables on the application server. If you edit both of them, you can redirect the temporary files to an alternative drive. The purpose of this solution is to have the temporary files accumulate in a location that has room for them. It will still be necessary to manually delete the files from that new location from time to time. Of course, you can eliminate this manual step by completing "Solution 2" as well.
- NOTE: This change at the environmental level impacts all temp location usages for all applications on the
- server, not just the DSP temporary file locations.
To change the storage location of temporary files on the application server:
- Navigate to Control Panel > System > Advanced system settings > Advanced > Environment Variables.
- In the System variables list box, select TEMP.
- Click Edit.
- Click Browse Directory...
- Select an alternative folder on a drive with more space.
- Repeat Steps 1-5, selecting TMP instead of TEMP in Step 2.
NOTE: You might need to reset IIS for the change to take place.
Solution 2: Remove the Temp Files
Retain the files for a limited time and then remove them. Deleting these files will have no impact if you need to free up memory in the short term.
- Write a script to remove files from the Temp folder after a certain retention period (such as 7 days).
- Here is an example Powershell script that removes any files older than 7 days from the
C:\Windows\Temp
path. Save these lines in a text editor asCleanTempFolder.ps1
.
$limit = (Get-Date).AddDays(-7)
$path = "C:\Windows\Temp"
# Delete files older than the $limit.
Get-ChildItem -Path $path -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.CreationTime -lt $limit } | Remove-Item -Force
# Delete any empty directories left behind after deleting the old files.
Get-ChildItem -Path $path -Recurse -Force | Where-Object { $_.PSIsContainer -and (Get-ChildItem -Path $_.FullName -Recurse -Force | Where-Object { !$_.PSIsContainer }) -eq $null } | Remove-Item -Force -Recurse
- Here is an example Powershell script that removes any files older than 7 days from the
- Register the script in Windows Task Scheduler so that it runs daily/nightly.
- Here are some example instructions for scheduling a Powershell script execution in Windows Task Scheduler: https://virtualizationreview.com/articles/2020/08/03/powershell-task-scheduler.aspx
NOTE: If you need assistance creating or scheduling the script, please open a ticket at support.syniti.com.