Standalone backup agent for Microsoft Windows servers and workstations (formerly Veeam Endpoint Backup FREE)
Post Reply
ViciousXUSMC
Influencer
Posts: 18
Liked: never
Joined: Dec 03, 2018 7:57 pm
Full Name: Patrick Mosley
Contact:

Pre/Post Thaw w/ Windows Agent

Post by ViciousXUSMC »

How does the pre/post thaw scripts function when backing up using the agent?
I need to use them to put a database into read only mode for backup (Symantec Enterprise Vault) so it needs to start before the backup, and the post script run at the end of the backup.

The job pre/post scripts wont work as their is not a way to set the credentials for the script. As a VM I know thaw scripts will work because the virtual disk gets locked as a snapshot.

So basically how does that work with a physical agent based machine where there is no way to freeze the disk? I assume (and hope) it waits until the end of the backup to run the post thaw script, but I am having issues right now with my post script so I am not sure if its Veeam or the script that I need to be looking at.
Dima P.
Product Manager
Posts: 14415
Liked: 1576 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Pre/Post Thaw w/ Windows Agent

Post by Dima P. »

Hi Patrick,

There is not pre or post job activity with Veeam Agent for Windows. Instead you can use Pre-Freeze and Post-Thaw Scripts as a part of Application Aware Image processing feature (so Server edition is required).

As a potential workaround you can create a custom script that does the desired action on your machine and only after triggers backup job via command line interface. Let me know if that helps. Cheers!
ViciousXUSMC
Influencer
Posts: 18
Liked: never
Joined: Dec 03, 2018 7:57 pm
Full Name: Patrick Mosley
Contact:

Re: Pre/Post Thaw w/ Windows Agent

Post by ViciousXUSMC »

I am using the Pre-Freeze and Post-thaw Scripts.
But my question was pretty simple, how does the timing of these work since you technically can not freeze or thaw a non VM disk?
Does the Thaw script run before the end of the backup job?
ViciousXUSMC
Influencer
Posts: 18
Liked: never
Joined: Dec 03, 2018 7:57 pm
Full Name: Patrick Mosley
Contact:

Re: Pre/Post Thaw w/ Windows Agent

Post by ViciousXUSMC »

Update: Answered my own question.
I can't believe that this is how it works, but it runs the pre script and post script back to back and does not wait for the job to finish, so I have no way in this configuration to backup this item.

Its a VERY basic feature to have a script run at the start and end of a job, so this feels like a significant oversight and I'll have to find a way to make it work.

So does anybody have any ideas?

I see the Before/After job script options under Storage -> Advanced -> Scripts where you can specify before this job and after this job, but I have no way to set credentials from Veeam to the account that has permissions for this task.
Dima P.
Product Manager
Posts: 14415
Liked: 1576 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Pre/Post Thaw w/ Windows Agent

Post by Dima P. »

Patrick,

Indeed there is no delay between the script execution and VSS snapshot creation. First Pre-Freeze script is executed, then agent creates snapshot and starts backup, once done Post-Thaw script is executed. Mind me asking is it possible to add the wait timeout directly inside the script? Thanks!
ViciousXUSMC
Influencer
Posts: 18
Liked: never
Joined: Dec 03, 2018 7:57 pm
Full Name: Patrick Mosley
Contact:

Re: Pre/Post Thaw w/ Windows Agent

Post by ViciousXUSMC »

I did figure something that is working.
It would be best for me to change the default 10 minute time out, because I do now have the scripts doing the wait, but Veeam is terminating the scripts after 10 minutes.
I changed the registry entry that I found by searching but it does not seem to have any effect on the thaw script timeout.

MaxGuestScriptTimeoutSec
Dima P.
Product Manager
Posts: 14415
Liked: 1576 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Pre/Post Thaw w/ Windows Agent

Post by Dima P. »

Patrick,

I am afraid that this registry value works for Veeam B&R and not for Veeam Agent for Windows. Have you tried to inject the start of backup job inside your script instead of using Pre-Freeze and Post-Thaw Scripts option with the backup job? Cheers!
ViciousXUSMC
Influencer
Posts: 18
Liked: never
Joined: Dec 03, 2018 7:57 pm
Full Name: Patrick Mosley
Contact:

Re: Pre/Post Thaw w/ Windows Agent

Post by ViciousXUSMC »

Yes I spent the better part of the day trying to use the Start/End scripts instead of the Thaw scripts.
It just was not working because I can not control the credentials, and it needs to run on the remote server not the BAR server.

I went down remote powershell and got that working but it was still giving me issues, I worked around the credentials issue by creating a scheduled task that ran as the correct user and then using remote powershell to launch that scheduled task, but in this particular case the object I needed to interact with (Symantec Enterprise Vault) was giving me permission denied even when called with the correct credentials with remote powershell.

I came up with a genius idea, and I'll share. Since the only issue I had with Thaw scripts is the fact that on an agent based job they fired back to back instead of start/end of the job. The solution was this.

1.) Create the backup job using a Pre-Thaw script - this works perfect as it lets me choose the correct credentials and it gets executed on the remote server.
2.) Completely leave the Post-Thaw script alone as it will not work for us, it does not wait for end of job.
3.) Create a 2nd Backup Job that just does something minor, like backup a single file.
4.) Schedule this backup to be chained to the original backup job.
5.) Give this "Post Backup" job a Pre-Thaw script that was originally intended as the "End of Job" script for the original backup.

This would probably work for 99.9% of the people that have a similar issue to me where Start/End scripts will not work due to how they are executed, and Thaw scripts will not work because they do not honor end of job timing on an agent based backup.

The only issue I still have is the fact that my Post job is timing out because SQL backup and maintenance is happening as part of my Pre-Thaw script, the Post-Thaw script is waiting for that to be done before it puts the database back into read/write mode. If that wait is greater than 10 minutes its timing out and failing.

However it appears that even if the script times out, it keeps running (Veeam does not terminate the script) - Am I correct in this assumption?
with that being the case, even though I get warned about the script time out, its still running in the background and doing its job.

It would be nice to know how to change the script time out for agent based backups however.
Dima P.
Product Manager
Posts: 14415
Liked: 1576 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Pre/Post Thaw w/ Windows Agent

Post by Dima P. »

Hello Patrick,

I believe the script wont be terminated (as we do control only the script start and not termination). Are you saying that agent in the question is managed by backup server? Thanks!
the_mentor
Enthusiast
Posts: 48
Liked: 8 times
Joined: Jul 26, 2012 11:10 pm
Full Name: DeMentor
Contact:

[MERGED] Post Backup Job Script support?

Post by the_mentor »

Hi there,
I was wondering if there is a way to trigger a post backup job script (preferably powershell)?

This would be really useful for many outside the box use cases.

thanks.
-DM
-DeMentor
DGrinev
Veteran
Posts: 1943
Liked: 247 times
Joined: Dec 01, 2016 3:49 pm
Full Name: Dmitry Grinev
Location: St.Petersburg
Contact:

Re: Post Backup Job Script support?

Post by DGrinev »

Hey,

There is no pre post job script execution feature, however, you can initiate post-thaw script from within AAPI in Server mode.
Please take a look on this existing discussion. Thanks!
Post Reply

Who is online

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