Added removing own logs.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
chcp 65001 >nul
|
||||||
set scriptPath=%~dp0
|
set scriptPath=%~dp0
|
||||||
set customPath=Z:\Servers\dayzserver\.customs
|
set customPath=Z:\Servers\dayzserver\.customs
|
||||||
|
|
||||||
|
|||||||
@@ -174,13 +174,14 @@ if ($update) {
|
|||||||
Write-Host "Making symbolic links to mods:"
|
Write-Host "Making symbolic links to mods:"
|
||||||
$clientMods | ForEach-Object {
|
$clientMods | ForEach-Object {
|
||||||
New-Item -ItemType SymbolicLink -Path "$($serverLocation)\$($_.Item1)" -Target "$($serverLocation)\steamapps\workshop\content\$($appidGame)\$($_.Item2)" -Force
|
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 {
|
$serverMods | ForEach-Object {
|
||||||
New-Item -ItemType SymbolicLink -Path "$($serverLocation)\$($_.Item1)" -Target "$($serverLocation)\steamapps\workshop\content\$($appidGame)\$($_.Item2)" -Force
|
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
|
Start-Sleep -Seconds 1
|
||||||
|
Write-Host
|
||||||
|
|
||||||
# Patching Namalsk
|
# Patching Namalsk
|
||||||
[bool]$isNamalskIslandPresent = $false
|
[bool]$isNamalskIslandPresent = $false
|
||||||
@@ -437,7 +438,17 @@ foreach ($srv in $servers) {
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ### wDayzManager ###
|
#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
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user