Set-VBRJobSchedule

In this article

    Short Description

    Modifies job schedule.

    Applies to

    Platform: VMware, Hyper-V

    Product Edition: Standard, Enterprise, Enterprise Plus, Veeam Universal License

    Syntax

    This cmdlet provides parameter sets that allow you to:

    • Schedule a job to run daily on specific time, on specific days of week.

    Set-VBRJobSchedule -Job <CBackupJob> [-Daily] [-At <datetime>] [-DailyKind {Everyday | WeekDays | SelectedDays}][-Days {Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday}] [-EnableBackupTerminationWindow][-TerminationWindow <VBRBackupWindowOptions>]  [<CommonParameters>]

    • Schedule a job to run monthly on specific time, on specific days of month, on specific months.

    Set-VBRJobSchedule -Job <CBackupJob> [-At <datetime>] [-Days {Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday}] [-Monthly] [-NumberInMonth {First | Second | Third | Fourth | Last | OnDay}] [-Months {January | February | March | April | May | June | July | August | September | October | November | December}] [-DayOfMonth <string>] [-EnableBackupTerminationWindow] [-TerminationWindow <VBRBackupWindowOptions>]  [<CommonParameters>]

    • Schedule a job to run periodically within specified period of time or continuously.

    Set-VBRJobSchedule -Job <CBackupJob> [-Periodicaly] [-FullPeriod <int>] [-PeriodicallyKind {Hours | Minutes | Continuously}] [-PeriodicallySchedule <VBRBackupWindowOptions>] [-PeriodicallyOffset <int>][-EnableBackupTerminationWindow] [-TerminationWindow <VBRBackupWindowOptions>]  [<CommonParameters>]

    • Schedule a job to run after a certain job you specify.

    Set-VBRJobSchedule -Job <CBackupJob> [-After] [-AfterJob <CBackupJob>] [-EnableBackupTerminationWindow][-TerminationWindow <VBRBackupWindowOptions>]  [<CommonParameters>]

    Detailed Description

    This cmdlet modifies schedule settings of a selected job.

    Parameters

    Parameter

    Description

    Required

    Position

    Accept
    Pipeline
    Input

    Accept
    Wildcard
    Characters

    Job

    Specifies the job you want to edit.

    True

    Named

    True (ByValue,
    ByProperty
    Name)

    False

    Daily

    For daily schedule.

    Indicates that the job runs daily.

    False

    Named

    False

    False

    At

    For daily schedule.

    Specifies the job start time.

    Default: 10:00.

    False

    Named

    False

    False

    DailyKind

    For daily schedule.

    Specifies the days to run the job:

    • Everyday: the job will run everyday.
    • Weekdays: the job will run Monday through Friday.
    • SelectedDays: the job will run on specific days (for example, Saturdays). Use the Days parameter to set the days.

    False

    Named

    False

    False

    Days

    For daily schedule.

    Specifies the days of week when the job will run.

    False

    Named

    False

    False

    EnableBackupTerminationWindow

    Defines that Veeam Backup & Replication will stop the Veeam Agent backup job if it exceeds the backup window.

    False

    Named

    False

    False

    TerminationWindow

    Specifies the time interval within which the backup job must complete. The cmdlet will create the Veeam Agent backup job with these settings.

    Accepts the VBRBackupWindowOptions type.

    False

    Named

    False

    False

    Monthly

    For monthly schedule.

    Indicates that the job runs once a month.

    False

    Named

    False

    False

    At

    For monthly schedule.

    Specifies the job start time.

    Default: 10:00.

    False

    Named

    False

    False

    NumberInMonth

    For monthly schedule.

    Specifies the number of day in month (for example, Saturday):

    • First: the job will run on the first (Saturday) of selected months.
    • Second: the job will run on the second (Saturday) of selected months.
    • Third: the job will run on the third (Saturday) of selected months.
    • Forth: the job will run on the forth (Saturday) of selected months.
    • Last: the job will run on the last (Saturday) of selected months.

    False

    Named

    False

    False

    Days

    For monthly schedule.

    Specifies the day of week for the NumberInMonth parameter.

    False

    Named

    False

    False

    Months

    For monthly schedule.

    Specifies the months when the job will run: January, February, March, April, May, June, July, August, September, October, November, December.

    False

    Named

    False

    False

    Periodicaly

    For periodical run.

    Indicates that the job runs periodically (for example, every 6 hours).

    Use FullPeriod and PeriodicallyKind parameters to set the periodical schedule.

    Use PeriodicallySchedule parameter to set backup window.

    False

    Named

    False

    False

    FullPeriod

    For periodical run.

    Specifies the number of hours or minutes for the PeriodicallyKind parameter.

    False

    Named

    False

    False

    PeriodicallyKind

    For periodical run.

    Specifies the periodically schedule type:

    • Hours: the job will run periodically in specifies number of hours (for example, every 6 hours).
    • Minutes: the job will run periodically in specified number of minutes (for example, every 30 minutes.
    • Continuously: the job will start right after it finished.

    False

    Named

    False

    False

    PeriodicallySchedule

    For periodical run.

    Specifies the backup window.

    Accepts VBRBackupWindowOptions type.

    False

    Named

    False

    False

    PeriodicallyOffset

    For periodical run.

    Used to set the exact time when the backup window starts.

    Specifies the number of minutes (1-59). The job will start at the hour set in the backup window plus the indicated period (for example, at 8:30).

    False

    Named

    False

    False

    After

    For running after a job.

    Indicates that the job will start after another job.

    Use AfterJob parameter to set the primary job.

    False

    Named

    False

    False

    AfterJob

    For running after a job.

    Specifies the job after which you want to run this job.

    False

    Named

    False

    False

    <CommonParameters>

    This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About CommonParameters section of Microsoft Docs.

    Examples

    Set-VBRJobScheduleExample 1. Scheduling Daily Backup Job

    This example shows how to schedule the Backup Job 01 job to run daily at 23:00 on weekdays.

    $job = Get-VBRJob -Name "Backup Job 01"

    Set-VBRJobSchedule -Job $job -Daily -At "23:00" -DailyKind Weekdays"

    Perform the following steps:

    1. Run the Get-VSBJob cmdlet. Specify the Name parameter value. Save the result to the $job variable.
    2. Run the Set-VBRJobSchedule cmdlet. Specify the following settings:
    • Set the $job variable as the Job parameter value.
    • Provide the Daily parameter value.
    • Specify the At parameter value.
    • Specify the DailyKind parameter value.

    Set-VBRJobScheduleExample 2. Scheduling Monthly Replication Jobs

    This example shows how to schedule all replication jobs to run monthly every last Saturday at 12:00 in February, May, August and December.

    $job = Get-VBRJob -Name Replica*

    Set-VBRJobSchedule -Job $job -Monthly -At "12:00" -NumberInMonth Last -Days Saturday -Months February, May, August, December

    Perform the following steps:

    1. Run the Get-VSBJob cmdlet. Specify the Name parameter value. Save the result to the $job variable.
    2. Run the Set-VBRJobSchedule cmdlet. Specify the following settings:
    • Set the $job variable as the Job parameter value.
    • Provide the Monthly parameter value.
    • Specify the At parameter value.
    • Specify the NumberInMonth parameter value.
    • Specify the Days parameter value.
    • Specify the Months parameter value.

    Set-VBRJobScheduleExample 3. Scheduling Job to Run Every Several Hours

    This example shows how to schedule the Daily Job to run every 12 hours.

    $job = Get-VBRJob -Name Daily Job

    Set-VBRJobSchedule -Job $job -Periodicaly -FullPeriod 12 -PeriodicallyKind Hours

    Perform the following steps:

    1. Run the Get-VSBJob cmdlet. Specify the Name parameter value. Save the result to the $job variable.
    2. Run the Set-VBRJobSchedule cmdlet. Specify the following settings:
    • Set the $job variable as the Job parameter value.
    • Provide the Periodicaly parameter.
    • Specify the FullPeriod parameter value.
    • Specify the PeriodicallyKind parameter value.

    Set-VBRJobScheduleExample 4. Scheduling Job to Run After Another Job

    This example shows how to schedule the Daily Job to run after the Database Job.

    $dbjob = Get-VSBJob -Name "Database Job"

    $dailyjob = Get-VBRJob -Name "Daily Job"

    Set-VBRJobSchedule -Job $dailyjob -After -AfterJob $dbjob

    Perform the following steps:

    1. Run the Get-VSBJob cmdlet. Specify the Name parameter value. Save the result to the $dbjob variable.
    2. Run the Get-VBRJob cmdlet. Specify the Name parameter value. Save the result to the $dailyjob variable.
    3. Run the Set-VBRJobSchedule cmdlet. Set the $dailyjob variable as the Job parameter value. Set the $dbjob as the AfterJob parameter value.

    Related Commands