PowerShell script exchange
Post Reply
Dario.Palmisano
Enthusiast
Posts: 31
Liked: 2 times
Joined: Nov 11, 2013 7:22 am
Full Name: Dario Palmisano
Contact:

How determine if a copy job completed...

Post by Dario.Palmisano »

Hello,

I wonder if someone can suggest me how I can determine with PowerShell if a copy backup job completed (eventually after having executed health check, compact full backup, etc.).

Till now I used to read key messages in the log produced by job, but many times it erroneously determine the job is completed when it is not!

Many thanks in advance for any hint!

Regards

Dario
Shestakov
Veteran
Posts: 7328
Liked: 781 times
Joined: May 21, 2014 11:03 am
Full Name: Nikita Shestakov
Location: Prague
Contact:

Re: How determine if a copy job completed...

Post by Shestakov »

Hello Dario,
Have you considered using job notifications?
Dario.Palmisano wrote:Till now I used to read key messages in the log produced by job, but many times it erroneously determine the job is completed when it is not!
Could you elaborate on that?
By the way, unlike backup job, backup copy one does not get "completed" since it works continuously and has 4 phases.
Thanks!
Dario.Palmisano
Enthusiast
Posts: 31
Liked: 2 times
Joined: Nov 11, 2013 7:22 am
Full Name: Dario Palmisano
Contact:

Re: How determine if a copy job completed...

Post by Dario.Palmisano »

Hello,

thanks for your answer.

Yes, you are right, but I created a script that enables the copy jobs after a backup is done and disables them after they have "completed" most of work.
I do this because I have many copy jobs and each holds some memory even when it is idle, but releases it when disabled.

As I said I monitor the log for understanding if a copy job completed most of the work. This seem to be failing sometime.

Most of the times (monitoring the log) I can successfully disable the job, but from time to time I get a warning status that I think is caused because I disabled the job before it completed some phase like health check or compact backup.

So I would like a way (if it exists) to understand if the copy job completed the work in this interval and will stay IDLE until the next.

I understand, I am possibly distorting the original logic behind the back copy job, but I need that in the environment I have

Thanks and regards

Dario
Shestakov
Veteran
Posts: 7328
Liked: 781 times
Joined: May 21, 2014 11:03 am
Full Name: Nikita Shestakov
Location: Prague
Contact:

Re: How determine if a copy job completed...

Post by Shestakov »

I see your point.
You can use "Waiting for the new copy interval" event in the session log as a pointer.
Another suggestion is not to orient on the Idle state, since it doesn`t mean for sure that the copying process is done.
Thanks!
Dario.Palmisano
Enthusiast
Posts: 31
Liked: 2 times
Joined: Nov 11, 2013 7:22 am
Full Name: Dario Palmisano
Contact:

Re: How determine if a copy job completed...

Post by Dario.Palmisano »

Thanks for your suggestion.

In my past testing I discovered that the following alternative pattern:

Waiting for the new copy interval*
Waiting for new restore points*

found in the log mean that the job "completed" (let me use this wrong term) and so it can successfully disabled, but from time to time I get a warning.

As I saw few answers (just yours, thanks) to my question I will try to find a way myself.

Best regards

Dario
Shestakov
Veteran
Posts: 7328
Liked: 781 times
Joined: May 21, 2014 11:03 am
Full Name: Nikita Shestakov
Location: Prague
Contact:

Re: How determine if a copy job completed...

Post by Shestakov »

What kind of warning did you get?
It may be not related to the time you disable the job.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How determine if a copy job completed...

Post by veremin »

You said you get errors when you try to disable a backup copy job, while it's running health check or compact full operation. Don't those operation get reflected in the log? If they do, it's just matter of adding additional checks to the already existing script. Like, if "waiting" entities are present, check whether there are no "health check" and/or "compact full" taking place. In case of negative answer, disable the job.

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests