Hi all,
I’m really stuck…and i think it’s easy to do…
I have a file like this :
SCHED Full 0 1 604800 1 0 0 0 *NULL* 0 0 0 0 0 0 -1 0 0 SCHEDWIN 0 0 0 0 0 0 0 0 61200 135000 0 0 0 0 SCHEDRES *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* SCHEDPOOL *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* SCHEDRL 1 1 1 1 1 1 1 1 1 1 SCHEDFOE 0 0 0 0 0 0 0 0 0 0 SCHEDSG *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* SCHED Incr 1 1 604800 1 0 0 0 *NULL* 0 0 0 0 0 0 -1 0 0 SCHEDWIN 0 0 0 0 0 0 0 0 0 0 0 0 0 0 SCHEDRES *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* SCHEDPOOL *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* SCHEDRL 1 1 1 1 1 1 1 1 1 1 SCHEDFOE 0 0 0 0 0 0 0 0 0 0 SCHEDSG *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL* *NULL*
It's the configuration of a schedule of a NetBackup strategy.
We have the config of the Full schedule and the incremental schedule.
i could have to select the Full or the Incr.
The line of the configuration of Backup start time is "SCHEDWIN", i need to select this line
I try something like that :
$Label = "Full" $ConfigBck = Get-Content "$PathConfig\$File" ForEach($line in $ConfigBck){ If($line -like "*$Label*"){ Write-Host "IF: $line" While($Line -notlike "*SCHEDWIN*"){ If ($foreach.moveNext()){ Write-Host "Config $PolicyName : $($foreach.current)" $Config = $($foreach.current) Write-Host "PolicyName: $PolicyName" } } } }
Not working at all
and this :
$SplitConf = Get-Content "$PathConfig\$File" | Select-String -Pattern "$Label" -context 0,2 ForEach($ligne in $SplitConf){ If($ligne -like "*SCHEDWIN*"){ Write-Host "$Ligne" } }
But in the $SplitConf, there is just one line.
So if the backup select is a full backup, how can i select the ligne SCHEDWIN ?
Thx for help.