Post Copy Job trigger

PowerShell script exchange

Post Copy Job trigger

Veeam Logoby b.vanhaastrecht » Wed Apr 23, 2014 8:16 am

Hi,

I've build a powershell script which should run after a Copy Job (with transform) completes. I can't find good reference about when the post script in a copy job sequence is triggered?
- when the sync interval ends?
- after the last VM has synced, waiting for new copy interval?
- after the transform?
- other?

Thanks again, regards,
Bastiaan
========================================
Veeam ProPartner and Cloud Connect Provider
b.vanhaastrecht
Service Provider
 
Posts: 337
Liked: 65 times
Joined: Mon Aug 26, 2013 7:46 am
Location: The Netherlands
Full Name: Bastiaan van Haastrecht

Re: Post Copy Job trigger

Veeam Logoby v.Eremin » Wed Apr 23, 2014 10:59 am

Once the data transfer and transformation are finished. Thanks.
v.Eremin
Veeam Software
 
Posts: 13285
Liked: 971 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Post Copy Job trigger

Veeam Logoby b.vanhaastrecht » Wed Apr 23, 2014 1:36 pm

Thank you v.Eremin, good to know.

My post copy job script disables the copy job so the last full file can be copied to dedupe unit. I've noticed when the script is done copying, it re-enables the copy job. After a few seconds the the post command gets triggered again. Is this normal behaviour?
========================================
Veeam ProPartner and Cloud Connect Provider
b.vanhaastrecht
Service Provider
 
Posts: 337
Liked: 65 times
Joined: Mon Aug 26, 2013 7:46 am
Location: The Netherlands
Full Name: Bastiaan van Haastrecht

Re: Post Copy Job trigger

Veeam Logoby v.Eremin » Wed Apr 23, 2014 1:44 pm

Does the script have enable part, as well? The assumption is that the script gets triggered after two events - data transfer's and transformation's end. Thanks.
v.Eremin
Veeam Software
 
Posts: 13285
Liked: 971 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Post Copy Job trigger

Veeam Logoby b.vanhaastrecht » Wed Apr 23, 2014 1:52 pm

Yes it does. The sequence of events is like this:
1) Copy Job runs
2) Copy job has copied data
3) Transform runs
4) Post script runs
4.1) Post script disables this copy job
4.2) Post script copies last vbk file
4.3) Post script enabled this copy job
5 Copy job starts (because it get's enabled)
6 Post script runs
6.1) I build in a routine in the script to detect a second run, script exits (does nothing with the job)
7 Job awaits new sync interval

I've noticed when the job gets enabled it logs "Starting full backup transformation" / "Full backup transformation completed successfully" with no time fields logged. So actually no transform has run. Has this perhaps triggered the second post command?
========================================
Veeam ProPartner and Cloud Connect Provider
b.vanhaastrecht
Service Provider
 
Posts: 337
Liked: 65 times
Joined: Mon Aug 26, 2013 7:46 am
Location: The Netherlands
Full Name: Bastiaan van Haastrecht

Re: Post Copy Job trigger

Veeam Logoby v.Eremin » Wed Apr 23, 2014 3:41 pm

As far as I know, the post job script gets executed each time you re-enable backup copy job. As the result, you get the said "loop". Having "auditorial" part that checks whether the script is executed second time should help you to avoid such situations. Thanks.
v.Eremin
Veeam Software
 
Posts: 13285
Liked: 971 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Post Copy Job trigger

Veeam Logoby b.vanhaastrecht » Thu Apr 24, 2014 9:10 am

Yes I think you are right. Probebly because a "fake" transform is triggered (with no Duration), the post command gets triggered. Perhaps this should be investigated by dev, it could be a bug.
Code: Select all
23-4-2014 15:27:17 :: Job started at 23-4-2014 15:27:15     <== job starts after enabling
23-4-2014 15:27:19 :: Continuing current copy interval
23-4-2014 15:27:21 :: Building VM list
23-4-2014 15:28:00 :: Starting full backup transformation     <== no transform is actually made, there's no time logged in the Duration collum
23-4-2014 15:28:00 :: Full backup transformation completed successfully   <== no transform is actually made, there's no time logged in the Duration collum
23-4-2014 15:28:03 :: All tasks have already been processed
23-4-2014 15:28:03 :: Waiting for the new copy interval
========================================
Veeam ProPartner and Cloud Connect Provider
b.vanhaastrecht
Service Provider
 
Posts: 337
Liked: 65 times
Joined: Mon Aug 26, 2013 7:46 am
Location: The Netherlands
Full Name: Bastiaan van Haastrecht

Re: Post Copy Job trigger

Veeam Logoby v.Eremin » Thu Apr 24, 2014 9:34 am

This is by design - the transformation process gets triggered each copy cycle. Thanks.
v.Eremin
Veeam Software
 
Posts: 13285
Liked: 971 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

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