Comprehensive data protection for all workloads
Post Reply
Ales
Novice
Posts: 4
Liked: never
Joined: Nov 14, 2016 12:45 pm
Contact:

Backup Copy job post script

Post by Ales »

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
foggy
Veeam Software
Posts: 21069
Liked: 2115 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Backup Copy job post script

Post by foggy »

How do you configure the post-job script? Do you use these settings?
Ales
Novice
Posts: 4
Liked: never
Joined: Nov 14, 2016 12:45 pm
Contact:

Re: Backup Copy job post script

Post by Ales »

Yes, I use that configuration option to set both powershell scripts.
foggy
Veeam Software
Posts: 21069
Liked: 2115 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Backup Copy job post script

Post by foggy »

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?
Ales
Novice
Posts: 4
Liked: never
Joined: Nov 14, 2016 12:45 pm
Contact:

Re: Backup Copy job post script

Post by Ales »

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.
foggy
Veeam Software
Posts: 21069
Liked: 2115 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Backup Copy job post script

Post by foggy »

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.
Ales
Novice
Posts: 4
Liked: never
Joined: Nov 14, 2016 12:45 pm
Contact:

Re: Backup Copy job post script

Post by Ales »

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?
foggy
Veeam Software
Posts: 21069
Liked: 2115 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Backup Copy job post script

Post by foggy »

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.
melexis
Influencer
Posts: 12
Liked: 2 times
Joined: Mar 31, 2018 5:40 pm
Contact:

[MERGED] Backup Copy Job after-job-script problem

Post by melexis »

Hi,

for off-site retention we do additional nightly backup copy jobs to Tandberg RDX.
We want to automatically eject the RDX media after all backup copy jobs are done (we have two backup copy jobs because VM backups and Agent backups of PMs cannot be processed in one single job).
For this I created a small script that is triggerd by the copy jobs and locks ejection while one of the two jobs is still running, otherwise ejects media.

Unfortunately I have one problem: the before-job-script is always executed, but the after-job-script sometimes not, especially in following cases:
- backup copy job has been restarted during usual interval and latest restore points are already copied
- backup copy job is missing/waiting for new restore point, this often happens when Client with Veeam Agent Client has been shut down, which is very common when you backup Client PCs

So how to deal with that stupid behaviour? Any workaround?

Veeam B&R V9.5 U3
foggy
Veeam Software
Posts: 21069
Liked: 2115 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

[MERGED] Re: Backup Copy Job after-job-script problem

Post by foggy »

The script runs after all data processing tasks complete or, in case there are any pending tasks, waits for the interval expiration, which looks consistent with what you're seeing.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 187 guests