Moved logs to subfolder.
Moved creating wDayzManager logs to subfolder.
This commit is contained in:
@@ -19,6 +19,8 @@ timeout 3 /nobreak >nul
|
|||||||
cd /d %scriptPath%
|
cd /d %scriptPath%
|
||||||
pushd %scriptPath%
|
pushd %scriptPath%
|
||||||
|
|
||||||
|
if not exist "Logs\" mkdir "Logs"
|
||||||
|
|
||||||
set update=0
|
set update=0
|
||||||
if "%1" equ "/U" set update=1
|
if "%1" equ "/U" set update=1
|
||||||
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
|
if "%1" equ "--update" set update=1
|
||||||
|
|
||||||
@REM powershell -ExecutionPolicy RemoteSigned -File wDayzManager.ps1 %update%
|
@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
|
popd
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# wDayzManager v0.2
|
# wDayzManager v0.3
|
||||||
# Copyright (c) 2024 Vladislav Salikov aka W0LF aka 'dreamforce'
|
# Copyright (c) 2024 Vladislav Salikov aka W0LF aka 'dreamforce'
|
||||||
# https://github.com/dreamforceinc
|
# https://github.com/dreamforceinc
|
||||||
# Required module: PSIni
|
# Required module: PSIni
|
||||||
@@ -229,7 +229,7 @@ if ($rotateLogs) {
|
|||||||
|
|
||||||
Write-Host "Removing old wDayzManager logs..."
|
Write-Host "Removing old wDayzManager logs..."
|
||||||
$fileList = $null
|
$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"
|
# Write-Host $fileList -Separator "`n"
|
||||||
foreach ($file in $fileList) {
|
foreach ($file in $fileList) {
|
||||||
Remove-Item -Path $file
|
Remove-Item -Path $file
|
||||||
|
|||||||
Reference in New Issue
Block a user