PowerShell script exchange
Post Reply
jkcouch
Enthusiast
Posts: 30
Liked: never
Joined: Jun 26, 2011 7:02 pm
Full Name: Jeff Couch
Contact:

V6 Where to set full settings in powershell pack

Post by jkcouch »

Looking for a place to set full schedule in v6 powershell pack. I see where i can enable it, but i am unable to define the scheduling params.

For instance, its currently set to enable fulls, but it defaults to weekly. I want to set it to monthly and roll through my jobs and stagger the full days based on a spreadsheet or an auto generated hash table or someting i put together.

Any suggestions?

ThomasMc
Expert
Posts: 293
Liked: 18 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: V6 Where to set full settings in powershell pack

Post by ThomasMc »

This should be enough to get you started and if you need any help just post back :)

Code: Select all

PS C:\> $job = Get-VBRJob -Name "VC Backup"
PS C:\> $schopt = $job | Get-VBRJobScheduleOptions
PS C:\> $jobopt = $job | Get-VBRJobOptions
PS C:\> $jobopt.BackupTargetOptions

Algorithm
FullBackupScheduleKind
FullBackupDays
FullBackupMonthlyScheduleOptions
TransformFullToSyntethic
TransformIncrementsToSyntethic
TransformToSyntethicDays

PS C:\> $schopt

StartDateTime
EndDateTimeSpecified
EndDateTime
RepeatSpecified
RepeatNumber
RepeatTimeUnit
RepeatTimeUnitMs
RetryTimes
RetryTimeout
RetrySpecified
WaitForBackupCompletion
BackupCompetitionWaitingPeriodMin
OptionsDaily
OptionsMonthly
OptionsPeriodically
OptionsContinuous
OptionsBackupWindow
NextRun
LatestRun

PS C:\> Set-VBRJobOptions -Job $job -Options $jobopt
PS C:\> Set-VBRJobScheduleOptions -Job $job -Options $schopt
Have a Merry Christmas

jkcouch
Enthusiast
Posts: 30
Liked: never
Joined: Jun 26, 2011 7:02 pm
Full Name: Jeff Couch
Contact:

Re: V6 Where to set full settings in powershell pack

Post by jkcouch »

Thanks Thomas!

In case someone else needs a way to schedule fulls this is the simple/slow way of doing it.

Below is my awful attempt at a CSV format on the forms. Just create a csv with the following columns. Fill in the table.

Code: Select all

JobName	ScheduleKind	DayOfWeek	DayNumberInMonth
Job01	Monthly		Monday		First
Job02	Monthly		Tuesday		First
The script:

Code: Select all

$Path = "\\Server\Path\FullSchedule.csv"

$Scheduletable = Import-Csv $Path

foreach ($Schedule in $Scheduletable){
# Set Job Properties
	$job = Get-VBRJob -Name $Schedule.JobName
	$JobOptions = $job | Get-VBRJobOptions
	$JobOptions.BackupTargetOptions.FullBackupScheduleKind = $Schedule.ScheduleKind
	$JobOptions.BackupTargetOptions.FullBackupMonthlyScheduleOptions.DayOfWeek = $Schedule.DayOfWeek
	$JobOptions.BackupTargetOptions.FullBackupMonthlyScheduleOptions.DayNumberInMonth = $Schedule.DayNumberInMonth
	Set-VBRJobOptions -Job $job -Options $joboptions
	}
		
You have a Merry Christmas as well! Thanks again for the pointer. Sometimes these things are burried in places that are not logical to me.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 6 guests