patrix87 / PowerShellGSM

A Comprehensive PowerShell Tool for Simple Automated Game Server Management.
https://github.com/patrix87/PowerShellGSM/
MIT License
109 stars 19 forks source link

Temp backup folder causing issue on some restarts. #59

Closed jakman76 closed 3 months ago

jakman76 commented 5 months ago

stated to use the PS a little bit ago - excellent work!

I was running into an issue with the temp-backup folder already existing error. Seems like the last backup was not correctly deleting the folder. This will exit the startup with error. (error: folder already exist in line 79 of Backup-Server.psm1. Maybe the compressor had a lock on the folder when the remove command was executed? I fixed the problem by adding another remove folder (new line 79) before creating it again: This works 100% now.

78: # Create a temporary directory 79: Remove-Item -Path "$($Backups.Path)\$Type\$((Get-Item $Backups.Saves).Name)" -Force -Recurse 80: $TempDirectory = New-Item -ItemType Directory -Path "$($Backups.Path)\$Type\$((Get-Item $Backups.Saves).Name)"