Comprehensive data protection for all workloads
Post Reply
arosas
Enthusiast
Posts: 63
Liked: 10 times
Joined: Jun 09, 2015 9:33 pm
Full Name: Tony Rosas
Contact:

Linking backup jobs

Post by arosas »

I'm looking for ideas on how to build a backup job that use the "After this Job" function under schedule and also scripts or maybe some other method? (i'm a novice when it comes to scripting but i can possibly figure it out)
Here's what I would like to have happen but not sure how to go about it.

SERVER1 and SERVER2 stop local service and kill a local running task.
Once completed (2 seconds), SERVER3 and SERVER4 stop local service and kill a local running task.
Local script runs to move log files from one local location to another local location on SERVER1-4.
Backup SERVER1-4 starts
Backup SERVER5 (SQL) starts
(SERVER1-5 can all backup at the same time)
Once backup for SERVER1-5 completes,
Start local service SERVER3 and SERVER4
Wait 5 seconds
Start local service on SERVER1 and SERVER2

This seems like it may not be doable but thought I would ask.
Thanks
Egor Yakovlev
Veeam Software
Posts: 2536
Liked: 680 times
Joined: Jun 14, 2013 9:30 am
Full Name: Egor Yakovlev
Location: Prague, Czech Republic
Contact:

Re: Linking backup jobs

Post by Egor Yakovlev »

Greetings Tony!

Seems like quite achievable task to me! You will need to make 2 scripts and put them into your backup job. Veeam will execute them for you.
Let me clear this process out:
- script will run all preparation steps before backup
- have 1 backup job(you said SERVER1-5 can be backed up simultaneously)
- script will start services back after backup completes

- Have a PowerShell script "Prepare_to_backup.ps1" that will:
1. Get-Service | Stop-Service for that service you mentioned on SERVER1 and SERVER2
2. Get-Process | Stop-Process to kill that running task on your SERVER1 and SERVER2
3. Start-Sleep for a few seconds
4. same for SERVER3 and SERVER4
5. Move-Item to move your logs around

- Have a PowerShell script "Restart_services _back.ps1" that will:
1. Get-Service | Start-Service on SERVER3-4
2. Start-Sleep
3. Get-Service " Start-Service on SERVER1-2

- Have 1 backup job for all servers in question. Add said scripts to job's Script Page.

Hope that helps!

p.s. make sure to check out difference between Pre-Job \ Post-Job scripts and Pre-Freeze \ Post-Thaw scripts options available in Veeam. Maybe they will make your day and you won't have to shut down services for entire backup duration but rather for a few seconds till we get VM snapshot done!
arosas
Enthusiast
Posts: 63
Liked: 10 times
Joined: Jun 09, 2015 9:33 pm
Full Name: Tony Rosas
Contact:

Re: Linking backup jobs

Post by arosas »

Hello Egor and thank you so much for that great outline!

I have looked at the documentation for the job script vs freeze\thaw scripts. From what I gathered, the pre-job\post job runs the scripts from the Veeam server so the script would be querying, stopping and starting the services remotely. To my understanding this is all run remotely using the Veeam service account?

Server 5 does not need the services started\stopped, only server1-4. If i were to include the script on the entire job, would it attempt to stop the services on server 5 and error out?
Egor Yakovlev
Veeam Software
Posts: 2536
Liked: 680 times
Joined: Jun 14, 2013 9:30 am
Full Name: Egor Yakovlev
Location: Prague, Czech Republic
Contact:

Re: Linking backup jobs

Post by Egor Yakovlev »

Main difference between Job and Freeze scripts is like this:
-> Pre-Job script -> Job starts -> Snapshot of VM -> Backup -> Snapshot Removal -> Job Ends -> After Job Script. So your services are down for the whole duration of a backup. Say minutes\hours?
vs.
-> Job Starts -> Pre-Freeze script -> Snapshot of VM -> Post-Thaw script -> Backup -> Snapshot Removal. So your services are down for like a few seconds!

I can only guess you want to shut down services to create an application-consistent backup, right? In that case pre-freeze\post-thaw might be the best option(that will tune a bit your initial plan explained in a first post).

And yeah, script will do whatever you tell it to do - so if you want to work with services only at SERVER1-4, it will work only for SERVER1-4!
arosas
Enthusiast
Posts: 63
Liked: 10 times
Joined: Jun 09, 2015 9:33 pm
Full Name: Tony Rosas
Contact:

Re: Linking backup jobs

Post by arosas »

We don't need to stop the services to create an application consistent backup, we need to stop them to prevent errors in the application due to the application being very sensitive to any interruption.
Servers1-4 are application servers while Server5 is the SQL server. When Server5 is snapshot the slight half second or a couple second blip affects the application servers. In order to prevent manual intervention we stop the services and allow the backup to complete before starting the services again. I do like the idea of testing it with pre-freeze and post thaw scripts but the services that need to interact with are not on the SQL server, they are on the 4 application servers.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Linking backup jobs

Post by veremin » 1 person likes this post

I do like the idea of testing it with pre-freeze and post thaw scripts but the services that need to interact with are not on the SQL server, they are on the 4 application servers.
You can set pre-freeze and post-thaw scripts on VM level - so, no issues here. Thanks!
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 165 guests