Moved logs to subfolder.

Moved creating wDayzManager logs to subfolder.
This commit is contained in:
2024-12-16 08:54:34 +03:00
parent 65c58da0f2
commit 35034f56c9
2 changed files with 5 additions and 3 deletions

View File

@@ -19,6 +19,8 @@ timeout 3 /nobreak >nul
cd /d %scriptPath%
pushd %scriptPath%
if not exist "Logs\" mkdir "Logs"
set update=0
if "%1" equ "/U" set update=1
if "%1" equ "/u" set update=1
@@ -27,6 +29,6 @@ if "%1" equ "-u" set update=1
if "%1" equ "--update" set update=1
@REM powershell -ExecutionPolicy RemoteSigned -File wDayzManager.ps1 %update%
powershell -ExecutionPolicy RemoteSigned -File wDayzManager.ps1 %update% > %filename%
powershell -ExecutionPolicy RemoteSigned -File wDayzManager.ps1 %update% > Logs\%filename%
popd

View File

@@ -1,4 +1,4 @@
# wDayzManager v0.2
# wDayzManager v0.3
# Copyright (c) 2024 Vladislav Salikov aka W0LF aka 'dreamforce'
# https://github.com/dreamforceinc
# Required module: PSIni
@@ -229,7 +229,7 @@ if ($rotateLogs) {
Write-Host "Removing old wDayzManager logs..."
$fileList = $null
$fileList = Get-ChildItem -Path $currentPath\*.log -Recurse | Where-Object { $_.LastWriteTime.Date -lt $date.AddDays( -3) }
$fileList = Get-ChildItem -Path $currentPath\Logs\*.log -Recurse | Where-Object { $_.LastWriteTime.Date -lt $date.AddDays( -3) }
# Write-Host $fileList -Separator "`n"
foreach ($file in $fileList) {
Remove-Item -Path $file