Nuova Funzione RotateOldLog e introduzione in CheckGitlabMirroring
This commit is contained in:
@@ -15,6 +15,24 @@ Function WriteLogOutput {
|
||||
}
|
||||
}
|
||||
|
||||
#rotazione file .log in .old
|
||||
Function RotateOldLog {
|
||||
$logPath = Join-Path $logFolder $logFile
|
||||
$oldLogPath = Join-Path $logFolder $oldLogFile
|
||||
#se file .old esiste sposto contenuto di attuale .log in coda a attuale .old e cancello attuale .log
|
||||
if (Test-Path $logPath){
|
||||
if (Test-Path $oldLogPath) {
|
||||
$from = Get-Content -Path $logPath
|
||||
Add-Content -Path $oldLogPath -Value $from
|
||||
Remove-Item -Path $logPath
|
||||
}
|
||||
#se file .old non esiste rinomino attuale file.log in file.old
|
||||
else {
|
||||
Get-ChildItem $logPath | Rename-Item -NewName { $_.Name -replace '.log','.old' }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#creazione nuovo mirror
|
||||
Function FreshMirrorCreation {
|
||||
Param ($projectNumber, $user, $auth, $destination, $path)
|
||||
|
||||
Reference in New Issue
Block a user