Backup of NAS, file shares, file servers and object storage.
Post Reply
MaPf
Enthusiast
Posts: 30
Liked: 2 times
Joined: Apr 07, 2020 6:23 pm
Full Name: Markus Pfohl
Contact:

Retry of FileShare Backup does not execute pre-job script

Post by MaPf »

This is more of a question than an issue:

We are backing up multiple fileshares in certain jobs.
To have a clean state, we do a snapshot of those shares with a script, backup those snapshots and release them after the job with another script.
That works fine on the first try.
If for some reason one share of that job is failing, a retry is triggered.
But on that retry I cannot see the pre-job script executed, the post job script on the other hand is working fine.
That could be seen in v11 and now in v12.

Is there a reason for that behaviour?
Mildur
Product Manager
Posts: 8735
Liked: 2296 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Retry of FileShare Backup does not execute pre-job script

Post by Mildur »

Hi Markus

Can you check if the same snapshot is protected from the first run?
If some shares are protected by the first snapshot and some shares by a second snapshot, your backup may not be consistent.
From my point of view it makes sense to have the script only run once and then use the scripts snapshots for all retries.

Best,
Fabian
Product Management Analyst @ Veeam Software
MaPf
Enthusiast
Posts: 30
Liked: 2 times
Joined: Apr 07, 2020 6:23 pm
Full Name: Markus Pfohl
Contact:

Re: Retry of FileShare Backup does not execute pre-job script

Post by MaPf »

I don't think I understand the question ...
There is no second snapshot..,


The pre-job script does a snapshot of each protected volume/share
The backup Job runs and either all shares backed up successfully or not.
The post-job script then releases/removes all snapshots.

If not all shares were successful backed up, a retry will start as per schedule settings

Here's a screenshot of such a retry. The job contains 8 shares in total, 2 were retried.
Image
Notice the missing pre-job script ?
mark49808
Enthusiast
Posts: 83
Liked: 13 times
Joined: Feb 02, 2017 6:31 pm
Contact:

Re: Retry of FileShare Backup does not execute pre-job script

Post by mark49808 »

Wouldn't that result in multiple snapshots lingering or possibly conflicts if every retry re-ran the pre-job script? I'd expect it NOT to rerun so the retry will use the snapshot taken during the initial pre-job script, which will still exist until the post-job script removes it.

The alternative seems to be a nightmare to manage with multiple retries and therefore potentially multiple snapshots (or whatever else the pre script may be doing). Maybe i'm missing something though.
MaPf
Enthusiast
Posts: 30
Liked: 2 times
Joined: Apr 07, 2020 6:23 pm
Full Name: Markus Pfohl
Contact:

Re: Retry of FileShare Backup does not execute pre-job script

Post by MaPf »

Wouldn't that result in multiple snapshots lingering or possibly conflicts if every retry re-ran the pre-job script? I'd expect it NOT to rerun so the retry will use the snapshot taken during the initial pre-job script, which will still exist until the post-job script removes it.
But after the first run the post-script is already executed, so there are no more snapshots for the retry.

My understanding is that is what the script options are for:
Do something before EVERY backup (in my case)
Do something after EVERY backup
The same is for retries, which IMO is a full job, except that it only applies to items that failed the previous job.
If my understanding is wrong, please advise.

Yes, the pre-script would also create snotshots from volumes that are not subject to the retry, but also the post-script would remove all of those -> no multiple snapshots

Snapshots would only be left if the actual job would crash for some reason and no post-script is executed ... but that is expected, can be easily solved by manually running the posts-script and is not related to my question.

Looking at the script options made me think ... is the first job and the retry possibly counting as one backup session?
But then again, why would the post-script be executed in both runs? :?
Mildur
Product Manager
Posts: 8735
Liked: 2296 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: Retry of FileShare Backup does not execute pre-job script

Post by Mildur »

Hi Markus

You could add a check in our script. When the script starts, check if the last run of the backup job was successful or not:
(Get-VBRJob -name JOBNAME).GetLastResult()

Only run your commands in the script if the job was successful.

Best,
Fabian
Product Management Analyst @ Veeam Software
MaPf
Enthusiast
Posts: 30
Liked: 2 times
Joined: Apr 07, 2020 6:23 pm
Full Name: Markus Pfohl
Contact:

Re: Retry of FileShare Backup does not execute pre-job script

Post by MaPf »

My scripts are cmd's that call a powershell script.

Anyway, I'm not sure what you want to achieve with that condition ...
With it the snapshots are taken only if the previous job was successful ...
I'd like the scripts to be executed on every job run, no matter the previous job result.
I will handle the snapshot management within the script, that's nothing Veeam should take care of.
Please ignore what my script does ... the point is: it is not executed on the retry, at least not the pre-job script

Just for comparison I made a test with a VM backup job, which made me realize that I probably placed the thread in the wrong forum, because the behaviour is not limited to File backups.

The initial run shows pre-script and post-script executed
Image
(I made the job fail on purpose by cutting the storage network)
The retry is showing the pre-script missing, but the post-script executed.
Image


The question remains: Why?
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests