Comprehensive data protection for all workloads
Post Reply
guidoakd
Influencer
Posts: 24
Liked: never
Joined: May 06, 2016 3:44 pm
Full Name: Guido G
Contact:

Is it possible to run tasks before or after a Backup?

Post by guidoakd »

Hello community,
i was looking with no luck through internet if it was possible to run some tasks before or after making a backup. For example, can i check if a windows service is up or down on the server i want to backup, previous to initializing the backup?

Thanks for your answers!
guidoakd
Influencer
Posts: 24
Liked: never
Joined: May 06, 2016 3:44 pm
Full Name: Guido G
Contact:

Re: Is it possible to run tasks before or after a Backup?

Post by guidoakd »

Update:

I've found this link
https://helpcenter.veeam.com/docs/backu ... l?ver=95u4

I think it's possible to execute scripts, but... is it possible to check some conditions, and depending on the results, to execute or NOT the Job?? That should be the goal.
For example: check if windows firewall is up on remote server, if its up, do the backup, if not, dont do the backup
foggy
Veeam Software
Posts: 21138
Liked: 2141 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Is it possible to run tasks before or after a Backup?

Post by foggy »

Hi Guido, yes, this is the functionality that allows what you're interested in. You can script everything you need with the help of PowerShell.
guidoakd
Influencer
Posts: 24
Liked: never
Joined: May 06, 2016 3:44 pm
Full Name: Guido G
Contact:

Re: Is it possible to run tasks before or after a Backup?

Post by guidoakd »

Foggy, how are you doing? Thanks for the answer.

I have a question about this.. if my script sends the order to stop 10 services on remote server... how does veeam knows when all services are down in order to begin the backup? It executes the script and inmediately after begins to backup? Or there is an option to tell veeam "execute this script, wait for 20 minutes, and then do the backup".

Thanks!
foggy
Veeam Software
Posts: 21138
Liked: 2141 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Is it possible to run tasks before or after a Backup?

Post by foggy »

I'm not sure if Veeam B&R handles pre-job script return codes in a way that you need, most likely it just logs a warning in the job session log in case the script fails (i.e. doesn't return zero). So an alternative solution would be stopping the job from the script itself. You may also consider using pre-freeze scripts, that have the corresponding settings.
guidoakd
Influencer
Posts: 24
Liked: never
Joined: May 06, 2016 3:44 pm
Full Name: Guido G
Contact:

Re: Is it possible to run tasks before or after a Backup?

Post by guidoakd »

Maybe you can help me with this.

I have a script, that stops a service if its running, and runs if its stopped. If i execute this powershell script, it works fine. But when i put it on a pre-job script in veeam, it says that it was executed succesfully, but checking the service, it remains in same state as at the beginning.. it means it doesnt worked.

Im executing my script with this sentence:
powershell.exe -File "C:\VeeamScripts\Nuevo.ps1"

That's OK?? Do i have to set any credentials anywhere? Thanks!
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Is it possible to run tasks before or after a Backup?

Post by veremin »

Have you tried to run the script, using Veeam Service account (this is the context within which the pre-job script gets executed)? Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 106 guests