Added removing own logs.
This commit is contained in:
@@ -174,13 +174,14 @@ if ($update) {
|
||||
Write-Host "Making symbolic links to mods:"
|
||||
$clientMods | ForEach-Object {
|
||||
New-Item -ItemType SymbolicLink -Path "$($serverLocation)\$($_.Item1)" -Target "$($serverLocation)\steamapps\workshop\content\$($appidGame)\$($_.Item2)" -Force
|
||||
Copy-Item -Path "$($serverLocation)\$($_.Item1)\Keys\*.bikey" -Destination "$($serverLocation)\keys\" -Force | Out-Null
|
||||
Copy-Item -Path "$($serverLocation)\$($_.Item1)\Keys\*.bikey" -Destination "$($serverLocation)\keys\" -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
$serverMods | ForEach-Object {
|
||||
New-Item -ItemType SymbolicLink -Path "$($serverLocation)\$($_.Item1)" -Target "$($serverLocation)\steamapps\workshop\content\$($appidGame)\$($_.Item2)" -Force
|
||||
Copy-Item -Path "$($serverLocation)\$($_.Item1)\Keys\*.bikey" -Destination "$($serverLocation)\keys\" -Force | Out-Null
|
||||
Copy-Item -Path "$($serverLocation)\$($_.Item1)\Keys\*.bikey" -Destination "$($serverLocation)\keys\" -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
Start-Sleep -Seconds 1
|
||||
Write-Host
|
||||
|
||||
# Patching Namalsk
|
||||
[bool]$isNamalskIslandPresent = $false
|
||||
@@ -437,7 +438,17 @@ foreach ($srv in $servers) {
|
||||
#endregion
|
||||
|
||||
#region ### wDayzManager ###
|
||||
Write-Host "Removing old wDayzManager logs..."
|
||||
|
||||
$fileList = $null
|
||||
$fileList = Get-ChildItem -Path $currentPath\*.log -Recurse | Where-Object { $_.LastWriteTime.Date -lt $date.AddDays( -3) }
|
||||
# Write-Host $fileList -Separator "`n"
|
||||
foreach ($file in $fileList) {
|
||||
Remove-Item -Path $file
|
||||
Write-Host "Removed $($file)!"
|
||||
}
|
||||
Write-Host "Total: $($fileList.Count)"
|
||||
Write-Host
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user