Skip to main content
Nintex Community Menu Bar
Solved

Service Account AppData folder size

  • October 12, 2017
  • 1 reply
  • 2 views

Forum|alt.badge.img+2

Hi.

 

Does anyone have a strategy for deleting the temporary files in the AppData-folder?

 

We've currently passed 5GB, and the folder was emptied out a little over a year ago.

I'm pretty confident deleting the files doesn't cause any harm, but does anyone have any input on this?

 

Thanks

 

 

 

Best answer by OAM

Ended up creating my own resolution here.

Ran on test-environment first and nothing seems to break.

 

Added the following powershell as a scheduled task. The script deletes all feilas and empty folder older than 150 days in the specified folder.

 

$limit = (Get-Date).AddDays(-150)
$path = "PATH_TO_THE TEMP_FOLDER"

# 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

 

View original
Translate
Did this topic help you find an answer to your question?

1 reply

Forum|alt.badge.img+2
  • Author
  • 4 replies
  • Answer
  • October 13, 2017

Ended up creating my own resolution here.

Ran on test-environment first and nothing seems to break.

 

Added the following powershell as a scheduled task. The script deletes all feilas and empty folder older than 150 days in the specified folder.

 

$limit = (Get-Date).AddDays(-150)
$path = "PATH_TO_THE TEMP_FOLDER"

# 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

 

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings