Host-based backup of Microsoft Hyper-V VMs.
Post Reply
JaxIsland7575
Veteran
Posts: 391
Liked: 107 times
Joined: Apr 27, 2015 1:59 pm
Full Name: Ryan Jacksland
Location: NY, USA
Contact:

Pre-Backup Script

Post by JaxIsland7575 »

I am trying to restart the VSS service on a server being backed up with VBR 9.5 U4. I have gone through a few attempts but so far they are all failing.

I created a .bat file with:
cd "C:\tools\PSTools"
PsService.exe \\servername restart vss

This file works locally or from the VBR server, but when I integrate it into the backup job it fails after 15 minutes of timing out. I am not sure how I can get this to restart the service prior to the backup running.
VMCE v9
PTide
Product Manager
Posts: 6431
Liked: 729 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Pre-Backup Script

Post by PTide »

Hi,

It's not quite clear what you are referring to as "pre-backup" - is it pre-freeze or pre-job?

Thanks!
JaxIsland7575
Veteran
Posts: 391
Liked: 107 times
Joined: Apr 27, 2015 1:59 pm
Full Name: Ryan Jacksland
Location: NY, USA
Contact:

Re: Pre-Backup Script

Post by JaxIsland7575 »

Edit Job -> Storage -> Advanced -> Scripts -> Run the following script before the job:
In there I selected the batch file from the local drive of the VBR server.
VMCE v9
PTide
Product Manager
Posts: 6431
Liked: 729 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Pre-Backup Script

Post by PTide »

Those scripts are run from the same service account that Veeam Backup Service is running under. Does the account have enough permissions to be able to restart VSS on the target server?

Thanks
JaxIsland7575
Veteran
Posts: 391
Liked: 107 times
Joined: Apr 27, 2015 1:59 pm
Full Name: Ryan Jacksland
Location: NY, USA
Contact:

Re: Pre-Backup Script

Post by JaxIsland7575 »

I added the service account as a local administrator on the server and ran the backup again. Same issue with the "Running pre-job script" just times out after 15 mins. I tried searching the logs and only found:

[08.03.2019 10:53:25] <01> Warning Pre-job script timed out
[08.03.2019 10:53:25] <01> Warning Pre-job script timed out
VMCE v9
PTide
Product Manager
Posts: 6431
Liked: 729 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Pre-Backup Script

Post by PTide »

Then I would suggest to echoing to file before and after each action in that script just to figure out where exactly it hangs, and if it starts at all.

Thanks
JaxIsland7575
Veteran
Posts: 391
Liked: 107 times
Joined: Apr 27, 2015 1:59 pm
Full Name: Ryan Jacksland
Location: NY, USA
Contact:

Re: Pre-Backup Script

Post by JaxIsland7575 »

I have a log file created and now the script runs in an instant and says its successful but the service on the server is not restarted. No errors logged in the file either.
VMCE v9
JaxIsland7575
Veteran
Posts: 391
Liked: 107 times
Joined: Apr 27, 2015 1:59 pm
Full Name: Ryan Jacksland
Location: NY, USA
Contact:

Re: Pre-Backup Script

Post by JaxIsland7575 »

To fix this, I created a batch file on the VM being backed up.

Code: Select all

sc \\servername stop vss
timeout /T 10 /nobreak
sc \\servername start vss
I edited the backup job to point to that file via a UNC path, ran the job and it worked. Needed to walk away from the issue and come back, simple answer after looking at it again.

Thanks for the help!
VMCE v9
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests