Comprehensive data protection for all workloads
Post Reply
Vitaliy S.
Product Manager
Posts: 22442
Liked: 1442 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Feature Request - Start time on Jobs

Post by Vitaliy S. » Jun 02, 2011 4:19 pm

Hello Barry,

You should be able to achieve that with PowerShell scripts and Windows Scheduler. Thanks.

rw_ga
Influencer
Posts: 11
Liked: 1 time
Joined: Apr 19, 2011 4:30 pm
Full Name: Ryan W
Contact:

Re: Feature Request - Start time on Jobs

Post by rw_ga » Jun 02, 2011 5:16 pm

Barry,

I saw a section on the backup job wizard that lets you specify when to allow the jobs to run. I don't recall where I saw that but I think it was on that last page where you specify when the job is to reoccur. I'm not able to check right now, but I think there was a button right out to the side that would allow you to disallow 6PM to 6AM. This would keep the job from running completely after 6pm.

Would that work?
RW

rw_ga
Influencer
Posts: 11
Liked: 1 time
Joined: Apr 19, 2011 4:30 pm
Full Name: Ryan W
Contact:

Re: Feature Request - Start time on Jobs

Post by rw_ga » Jun 02, 2011 6:30 pm

We use Veeam for Backup and Recovery. We use a combination of Symantec Backup Exec (transfer Veeam Backups to tape), Symantec System Recovery (backup the BE Media server which is also where Veeam B&R is installed), and the Veeam backup files for disaster recovery.

Backup and Recovery:
I'm using multiple jobs for the different server types in our environment. Most of our Veeam Backup Jobs use the reverse incremental option every 12hours with a weekly or monthly full. For the more critical servers, we setup the jobs to do a full daily and incrementals at 15min, 30min, or whatever. We used the incrementals for these servers because in our environment the reverse incrementals didn't seem to finish when you have such a small backup window (15min).

Disaster Recovery:
We use Backup Exec to transfer the Veeam files over to tape. To transfer the Veeam jobs that use the reverse incrementals, I setup a Full BE job targeting the Veeam folder. I edited the file selection list to exclude the 'vrb' files. (suggested in another post). For the Veeam jobs that used the Daily Full and Incrementals, I setup an Incremental BE job that uses the archive bit option. Then I setup Symantec System Recovery to backup this server that holds all the backup applications and configurations.

I setup 2 post posershell scripts, 1 for the Veeam job (PostVeemJob1.ps1) and 1 for the BE job (PostBEJob1.ps1). I had called tech support for help on this, I was wondering when the full backup job ran. Thanks for the jump start on this! They told me it runs at Midnight. I guess this could hurt a few IT shops if they have too many independent jobs setup to backup individual servers on the same lun, but we don't have the option to change this. Maybe a reason this request could be useful??? Anyway, I played around with the idea to run a script every cycle after the Veeam job completed to check the time, kick off the BE job, and disable the Veeam job. Then I'd have the BE job re-enable the Veeam job after it completes. The only thing concerning me was what if I missed that full backup at MIDNIGHT. Well it appears that if you have a Veeam Backup Job disabled at MIDNIGHT it will run the full backup as soon as it is re-enabled. What a relief. :D Now if my BE JOBS get backed up in the job queue, then I won't miss the full!!!

PostVeeamJob1.ps1

Code: Select all

#This script is intended to allow a Backup Exec Job to run at a time that will backup/transfer just one set of a daily full and it's incrementals.

#Load the Veeam PowerShell Snap In if it isn't already.
if((Get-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue) -eq $null){
    Add-PSSnapin "VeeamPSSnapIn"
}

#Defined Static Variables.  You will need to use the correct Job names for 'VeeamBackupJobName' and '-jBackupExecJobName'. Don't leave out the '-j' prefix on the BE job.
$job = Get-VBRJob | where {$_.name -eq "VeeamBackupJobName"}
$BEJob = "-jBackupExecJobName"
$BEPath = "C:\Program Files\Symantec\Backup Exec"
$BEBackupCmd = "-o01"
$BEStatusCmd = "-o15"

#Current Time.
$CurrentHour = (Get-Date).Hour
$CurrentMinute = (Get-Date).Minute

#Since this job is run every 15 minutes, I have the script check to see if it is 11PM or later.
If ($CurrentHour -ge 23) {
    If ($CurrentMinute -ge 00) {

	#Manually Launch the Backup Exec Incremental Job.
	& "$BEPath\bemcmd.exe" $BEBackupCmd $BEJob

    #Make Sure the BE Job gets scheduled.
	Do{
	     #Get the Status of the Backup Exec Job.
	     $BEStatus = & "$BEPath\bemcmd.exe" $BEStatusCmd $BEJob
	     $BEStatusCode = $BEStatus[1].split(":")[1].trim(" ")

	     #Put the Script to Sleep for 30 Seconds.
	     Start-Sleep -s 30
	}

    #I need to revisit this next line of code to make sure it should be the 'Until -ne' and not a 'While -eq', but I believe its working.
    Until ($BEStatusCode -ne 18 -or $BEStatusCode -ne 16)

	#Disable Veeam Backup Job.
	$job.DisableScheduler()

    }
}
PostBEJob1.ps1

Code: Select all

#This script is intended to Enable a Veeam Job after the BE job.

#Load the Veeam PowerShell Snap In if it isn't already.
if((Get-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue) -eq $null){
    Add-PSSnapin "VeeamPSSnapIn"
}

#Defined Static Variables. You will need to use the correct 'VeeamBackupJobName'.
$JobName = "VeeamBackupJobName"
$job = Get-VBRJob | where {$_.name -eq $JobName}

#Enable Veeam Job.
$job.EnableScheduler()

#Make Sure the Veeam Job Gets Enabled.
$ScheduleStatus = $job.Info.IsScheduleEnabled
if($ScheduleStatus -ne "True"){
    Do{
        #Enable Veeam Job.
        $job.EnableScheduler()
     
        #Get the Status of the Veeam Job.
        $ScheduleStatus = $job.Info.IsScheduleEnabled
        
        #Put the Script to Sleep for 30 Seconds.
        Start-Sleep -s 30
    }
  
    #See if the Veeam Job is Enabled.
    Until ($ScheduleStatus -eq "True")
}
If anyone sees something that I should take into consideration, PLEASE let me know.

Thanks,
RW

rw_ga
Influencer
Posts: 11
Liked: 1 time
Joined: Apr 19, 2011 4:30 pm
Full Name: Ryan W
Contact:

Re: Feature Request - Start time on Jobs

Post by rw_ga » Jun 02, 2011 9:48 pm

I forgot a line or two in the Do loop. Maybe even more. This is a work in progress. New Script (code edited on the fly) for PostVeeamJob1.ps1

Code: Select all

#This script is intended to allow a Backup Exec Job to run at a time that will backup/transfer just one set of a daily full and it's incrementals.

#Load the Veeam PowerShell Snap In if it isn't already.
if((Get-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue) -eq $null){
    Add-PSSnapin "VeeamPSSnapIn"
}

#Defined Static Variables.  You will need to use the correct Job names for 'VeeamBackupJobName' and '-jBackupExecJobName'. Don't leave out the '-j' prefix on the BE job.
$job = Get-VBRJob | where {$_.name -eq "VeeamBackupJobName"}
$BEJob = "-jBackupExecJobName"
$BEPath = "C:\Program Files\Symantec\Backup Exec"
$BEBackupCmd = "-o01"
$BEStatusCmd = "-o15"

#Current Time.
$CurrentHour = (Get-Date).Hour
$CurrentMinute = (Get-Date).Minute

#Since this job is run every 15 minutes, I have the script check to see if it is 11PM or later.
If ($CurrentHour -ge 23) {
    If ($CurrentMinute -ge 00) {

	#Manually Launch the Backup Exec Incremental Job.
	& "$BEPath\bemcmd.exe" $BECmd $BEJob

    #Make Sure the BE Job gets scheduled.
	Do{
	    #Get the Status of the Backup Exec Job.
	    $BEStatus = & "$BEPath\bemcmd.exe" $BEStatusCmd $BEJob
	    $BEStatusCode = $BEStatus[1].split(":")[1].trim(" ")

            Switch ($BEStatusCode){
                18 {}
                16 {}
                Default {
                    #Manually Launch the Backup Exec Incremental Job.
                    & "$BEPath\bemcmd.exe" $BECmd $BEJob
	    
                    #Get the Status of the Backup Exec Job.
	               $BEStatus = & "$BEPath\bemcmd.exe" $BEStatusCmd $BEJob
	               $BEStatusCode = $BEStatus[1].split(":")[1].trim(" ")

	               #Put the Script to Sleep for 30 Seconds.
	               Start-Sleep -s 30
                }
            }  
    }
    #See if the Backup Exec Job is Scheduled or Running.
    Until ($BEStatusCode -ne 18 -or $BEStatusCode -ne 16)
    }
}
	#Disable Veeam Backup Job.
	$job.DisableScheduler()
RW

BarryCoombs
Enthusiast
Posts: 30
Liked: never
Joined: May 22, 2009 2:46 pm
Contact:

Re: Feature Request - Start time on Jobs

Post by BarryCoombs » Jun 03, 2011 6:34 am

Vitaliy S. wrote:Hello Barry,

You should be able to achieve that with PowerShell scripts and Windows Scheduler. Thanks.

Is that really the only way, we stopped using vranger back in the day to avoid windows scheduler and scripted backups. Is this going to be corrected in v6

Vitaliy S.
Product Manager
Posts: 22442
Liked: 1442 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Feature Request - Start time on Jobs

Post by Vitaliy S. » Jun 03, 2011 8:18 am

Barry, have you considered using the scheduling control to disallow hours where you do not want your jobs to run?

BarryCoombs
Enthusiast
Posts: 30
Liked: never
Joined: May 22, 2009 2:46 pm
Contact:

Re: Feature Request - Start time on Jobs

Post by BarryCoombs » Jun 03, 2011 9:34 am

I need the backup to run at every hour on the dot between 6am and 6pm. I am backing up a SQL server so there is a requirement that they are backed up on the hour. I don't believe scheduling control will help me with this?

Vitaliy S.
Product Manager
Posts: 22442
Liked: 1442 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Feature Request - Start time on Jobs

Post by Vitaliy S. » Jun 03, 2011 10:42 am

True, scheduling control will not trigger the job at 6 am. Thanks for your feedback anyway.

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

Re: Feature Request - Start time on Jobs

Post by ThomasMc » Jun 03, 2011 10:50 am

BarryCoombs wrote:I need the backup to run at every hour on the dot between 6am and 6pm. I am backing up a SQL server so there is a requirement that they are backed up on the hour. I don't believe scheduling control will help me with this?

You could use something like SQLBackupAndFTP, very cheap and would do a job.

rw_ga
Influencer
Posts: 11
Liked: 1 time
Joined: Apr 19, 2011 4:30 pm
Full Name: Ryan W
Contact:

Re: Feature Request - Start time on Jobs

Post by rw_ga » Jun 03, 2011 11:59 am

rw_ga wrote:I forgot a line or two in the Do loop. Maybe even more. This is a work in progress. New Script (code edited on the fly) for PostVeeamJob1.ps1

Code: Select all

#This script is intended to allow a Backup Exec Job to run at a time that will backup/transfer just one set of a daily full and it's incrementals.

#Load the Veeam PowerShell Snap In if it isn't already.
if((Get-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue) -eq $null){
    Add-PSSnapin "VeeamPSSnapIn"
}

#Defined Static Variables.  You will need to use the correct Job names for 'VeeamBackupJobName' and '-jBackupExecJobName'. Don't leave out the '-j' prefix on the BE job.
$job = Get-VBRJob | where {$_.name -eq "VeeamBackupJobName"}
$BEJob = "-jBackupExecJobName"
$BEPath = "C:\Program Files\Symantec\Backup Exec"
$BEBackupCmd = "-o01"
$BEStatusCmd = "-o15"

#Current Time.
$CurrentHour = (Get-Date).Hour
$CurrentMinute = (Get-Date).Minute

#Since this job is run every 15 minutes, I have the script check to see if it is 11PM or later.
If ($CurrentHour -ge 23) {
    If ($CurrentMinute -ge 00) {

	#Manually Launch the Backup Exec Incremental Job.
	& "$BEPath\bemcmd.exe" $BECmd $BEJob

    #Make Sure the BE Job gets scheduled.
	Do{
	    #Get the Status of the Backup Exec Job.
	    $BEStatus = & "$BEPath\bemcmd.exe" $BEStatusCmd $BEJob
	    $BEStatusCode = $BEStatus[1].split(":")[1].trim(" ")

            Switch ($BEStatusCode){
                18 {}
                16 {}
                Default {
                    #Manually Launch the Backup Exec Incremental Job.
                    & "$BEPath\bemcmd.exe" $BECmd $BEJob
	    
                    #Get the Status of the Backup Exec Job.
	               $BEStatus = & "$BEPath\bemcmd.exe" $BEStatusCmd $BEJob
	               $BEStatusCode = $BEStatus[1].split(":")[1].trim(" ")

	               #Put the Script to Sleep for 30 Seconds.
	               Start-Sleep -s 30
                }
            }  
    }
    #See if the Backup Exec Job is Scheduled or Running.
    Until ($BEStatusCode -ne 18 -or $BEStatusCode -ne 16)
    }
}
	#Disable Veeam Backup Job.
	$job.DisableScheduler()
RW
This needs some mods, I ran into a problem with the way I was checking the time, The only way I know how to try and fix this is to change the two variables into one like so:

#Current Time.
$CurrentTime = Get-Date -format HHmm

#See if it is 11PM or later.
If ($CurrentTime -ge 2300) {

Also, I put a closing bracket } in the wrong place at the bottom of the script. The disable part should be moved up like so:

}
#See if the Backup Exec Job is Scheduled or Running.
Until ($BEStatusCode -ne 18 -or $BEStatusCode -ne 16)

#Disable Veeam Backup Job.
$job.DisableScheduler()
}

Any Powershell Gurus out there that can review these scripts and give them a proper examination.

Thanks,
RW

rw_ga
Influencer
Posts: 11
Liked: 1 time
Joined: Apr 19, 2011 4:30 pm
Full Name: Ryan W
Contact:

Re: Feature Request - Start time on Jobs

Post by rw_ga » Jun 03, 2011 12:13 pm

BarryCoombs wrote:I need the backup to run at every hour on the dot between 6am and 6pm. I am backing up a SQL server so there is a requirement that they are backed up on the hour. I don't believe scheduling control will help me with this?
Barry,

Just out of curiosity, why on the hour every hour and only between 6am to 6pm? Policy???

If you use "1 hr periodically" on the scheduling page, you would get backups every hour, maybe not on the hour, but every hour.

Our SQL servers are backed up every 15min 24/7 with the exception that we don't back them up while the Backup Exec Job is transferring the files over to tape (only an hour or so).

Vitaliy, If Barry used the every hour option with hours disallowed for 6pm to 6am, wouldn't the job kick off at 6am and then run every hour afterward?

RW

lvh
Novice
Posts: 4
Liked: never
Joined: Mar 04, 2010 8:49 am
Full Name: Lars Viggo Høyer
Contact:

Replication schedule problem.

Post by lvh » Jun 21, 2011 8:24 am

[merged]

Hi

Is there no way to change the schedule for replication running every hour so that several jobs don't run at exact the same time. I have three rep. job made that by itself ends up running at at same time every hour causing one of them to fail. Shortly after it's retried and runs without any problems.
Yesterday I tried to recreate the job so execution time was different, but this morning it failed again because it has moved start time to the same as the other jobs again !!

I can't find anywhere to set schedule ..

Thanks in advance
Lars Hoyer

tsightler
VP, Product Management
Posts: 5310
Liked: 2162 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Feature Request - Start time on Jobs

Post by tsightler » Jun 21, 2011 1:46 pm

This would be a nice enhancement, i.e., being able to set a specific replication time for hourly replication, rather than using the current "rolling" schedule or having to drop to scheduling via Windows scheduler (which is frowned on in our environment). Also, the ability to limit the number of simultaneously running jobs would be nice as well so that if you had 5-6 jobs that would overlap, they would only run 2 at a time (or whatever number the administrator selects). Right now we have to attempt to manually schedule our jobs so that they don't overlap but this is very difficult to predict when you're also trying to optimize the backup window to the shortest period of time.

Gostev
SVP, Product Management
Posts: 24092
Liked: 3280 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Feature Request - Start time on Jobs

Post by Gostev » Jun 21, 2011 3:55 pm

We are making some architecture improvements in the next release to address that. Simultaneous parallel jobs overlap will be handled in an automated fashion, which we hope should be more robust and manageable approach than coordinating run times manually between dozens of jobs to make sure there is no overlap (or that such overlap has controlled concurrency). Besides, one can never predict how long specific job will run on specific day, so manual scheduling approach simply won't work anyway, because jobs will still be overlapping sometimes depending on environmental conditions. Instead, the v6 engine will adjust to actual conditions by itself, automatically. Thanks!

ns00h
Novice
Posts: 8
Liked: never
Joined: May 20, 2010 5:36 am
Full Name: Nathan Simpson
Contact:

Re: Feature Request - Start time on Jobs

Post by ns00h » Oct 17, 2011 4:51 am

How long before these improvements are released?

Currently running 5.0.2.230 and using "Periodically every" with jobs that start at 6am. Now all these jobs run in parallel every hour. So this would be most welcome.

Thanks
Nathan

Post Reply

Who is online

Users browsing this forum: frankive and 33 guests