Backup Copy job post script

Availability for the Always-On Enterprise

Backup Copy job post script

Veeam Logoby Ales » Wed Nov 16, 2016 1:29 pm

Hi,

I'm trying to configure a Backup Copy job to copy to an Azure VM.
The idea was that I would use the pre and post scripts to start/shutdown the Azure VM and take care of the VPN connection.

The problem is as this is a continuous job it doesn't really stop at all. So my pre script runs, then the copy/sync session but after that it sits there idle and does not execute the post scripts so my VM continues running.

I wonder if there is some reliable method to start the post script once the idle phase starts or if it's possible to run the whole Backup Copy job manually from a Powershell script at a given time and only at that time?

Regards,
Ales
Ales
Novice
 
Posts: 4
Liked: never
Joined: Mon Nov 14, 2016 12:45 pm

Re: Backup Copy job post script

Veeam Logoby foggy » Wed Nov 16, 2016 1:51 pm

How do you configure the post-job script? Do you use these settings?
foggy
Veeam Software
 
Posts: 14742
Liked: 1080 times
Joined: Mon Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson

Re: Backup Copy job post script

Veeam Logoby Ales » Wed Nov 16, 2016 1:59 pm

Yes, I use that configuration option to set both powershell scripts.
Ales
Novice
 
Posts: 4
Liked: never
Joined: Mon Nov 14, 2016 12:45 pm

Re: Backup Copy job post script

Veeam Logoby foggy » Wed Nov 16, 2016 2:09 pm

As far as I can recall, the script should trigger after data transfer tasks complete (i.e. exactly when the "idle" stage starts). Isn't that the case?
foggy
Veeam Software
 
Posts: 14742
Liked: 1080 times
Joined: Mon Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson

Re: Backup Copy job post script

Veeam Logoby Ales » Wed Nov 16, 2016 2:50 pm

I also assumed that's how it should work but it doesn't.
The job get's started, the pre script is run and then after finding out there are no up-to-date restore points it goes to idle without executing the post script.
Ales
Novice
 
Posts: 4
Liked: never
Joined: Mon Nov 14, 2016 12:45 pm

Re: Backup Copy job post script

Veeam Logoby foggy » Wed Nov 16, 2016 3:16 pm

Ales wrote:after finding out there are no up-to-date restore points

In this case it is expected that the script waits for the interval to expire as new restore points might appear at any time.
foggy
Veeam Software
 
Posts: 14742
Liked: 1080 times
Joined: Mon Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson

Re: Backup Copy job post script

Veeam Logoby Ales » Thu Nov 17, 2016 10:01 am

So from what I tested tonight, this is how I think it works:

After the Copy Job is started it runs the pre script and than checks for:
  • Is the current time in the synchronization interval?
  • Is the current time in the Backup Copy window (Data transfer window) if it's not set to "any time"?
  • Are there any valid and up-to-date restore points that match the formula "Time of restore point creation >= current time – synchronization interval"?

If all of the above is true it starts with the Synchronization process after that the Transform operations and then if both were successful and all the configured restore points were transferred, only then does it run the post script and goes into the Idle state phase where it waits for new restore points or the end of the configured synchronization interval, whichever happens first.

After the new synchronization interval starts, the pre script is run again and the whole cycle repeats.

Do I understand it correctly or is there a flaw in my reasoning?
Ales
Novice
 
Posts: 4
Liked: never
Joined: Mon Nov 14, 2016 12:45 pm

Re: Backup Copy job post script

Veeam Logoby foggy » Thu Nov 17, 2016 11:27 am

Yes, the only flaw is that it will not copy the second restore point if it appears within the same sync interval (just a single restore point is copied within each interval), so it just waits for the end of the interval.
foggy
Veeam Software
 
Posts: 14742
Liked: 1080 times
Joined: Mon Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson


Return to Veeam Backup & Replication



Who is online

Users browsing this forum: No registered users and 26 guests