-
- Influencer
- Posts: 24
- Liked: never
- Joined: Jan 27, 2015 9:14 pm
- Full Name: Emil Antonio
- Contact:
Is it possible to trigger a Veeam backup job from within SQL
We want to run a Veeam backup job right after we run a Native SQL Backup. Is it possible to trigger a Veeam backup job from within SQL scheduler? i.e. using a Power Shell script to trigger the job from the SQL server?
-
- Product Manager
- Posts: 20655
- Liked: 2374 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
Why not to schedule native sql backup as pre-freeze script?
-
- Veteran
- Posts: 387
- Liked: 97 times
- Joined: Mar 24, 2010 5:47 pm
- Full Name: Larry Walker
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
If the sql command can be run using sqlcmd then create a bat file run your SQL commands ( backup plus what ever you need to do ) then run a PS1 file from the bat to do the veeam stuff you can find examples posted here if not I can find something.
Or better is a Veeam job with a pre bat job that runs your sql commands from a bat file using sqlcmd - I posted example a few years ago. then let veeam do its thing.
Or better is a Veeam job with a pre bat job that runs your sql commands from a bat file using sqlcmd - I posted example a few years ago. then let veeam do its thing.
-
- Product Manager
- Posts: 20655
- Liked: 2374 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
Yep. Larry's nailed it. Why to bother with SQL scheduler, if everything can be run from one console. Just set the appropriate scripts as pre-job activity or pre-freeze scripts, so that, native SQL tools take care about SQL stuff prior to Veeam creates a backup of the VM. Thanks.
-
- Influencer
- Posts: 24
- Liked: never
- Joined: Jan 27, 2015 9:14 pm
- Full Name: Emil Antonio
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
Can you please provide the link where I can get a sample pre & post scripts to run a native sql backup first and then run veeam backup afterwards. Thank you.
-
- Veeam Software
- Posts: 6188
- Liked: 1978 times
- Joined: Jul 26, 2009 3:39 pm
- Full Name: Luca Dell'Oca
- Location: Varese, Italy
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
I wonder even more if the SQL backup is needed at all, since we have support for SQL backups plus restores down to the single transaction natively in our software.
Luca Dell'Oca
Principal EMEA Cloud Architect @ Veeam Software
@dellock6
https://www.virtualtothecore.com/
vExpert 2011 -> 2022
Veeam VMCE #1
Principal EMEA Cloud Architect @ Veeam Software
@dellock6
https://www.virtualtothecore.com/
vExpert 2011 -> 2022
Veeam VMCE #1
-
- Influencer
- Posts: 24
- Liked: never
- Joined: Jan 27, 2015 9:14 pm
- Full Name: Emil Antonio
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
My DBA Admin still want to do a native SQL backup on top of Veeam backup. Can you please provide a link where I can find sample scripts to do this?
-
- Veteran
- Posts: 387
- Liked: 97 times
- Joined: Mar 24, 2010 5:47 pm
- Full Name: Larry Walker
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
sqlcmd -S YOUR_SERVER_NAME\SQLName -E -Q "EXEC sp_BackupDatabases @backupLocation='C:\SQL_Backup
You can also run an update script first which we need to do which is why you go this route, update tables, run sql backup in pre veeam let veeam run backup run, done.
You can also run an update script first which we need to do which is why you go this route, update tables, run sql backup in pre veeam let veeam run backup run, done.
-
- Product Manager
- Posts: 20655
- Liked: 2374 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
If this request is coming from DB admin, why not to ask him to provide the required scripts that should be executed prior to backup jobs, according to his opinion? He should be well aware of those.
-
- Influencer
- Posts: 24
- Liked: never
- Joined: Jan 27, 2015 9:14 pm
- Full Name: Emil Antonio
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
My DBA gave me this script:
"D:\MSSQL\100\DTS\Binn\dtexec.exe /SQL "Maintenance Plans\Admin-Backup" /SERVER OURSERVERNAMEHERE /CHECKPOINTING OFF /SET "\Package\Full.Disable";false /REPORTING E"
I created a batch file and put this command in there and then added it in the Veeam backup setting _ Storage > Advance Settings > Advance tab > Job Scripts - Run the following script before the job.
Does the batch file get copied to the remote server and then run locally in the remote server? or does it execute from the Veeam server?
If I go to the remote server and run this command, it completes successfully. When I run it from the Veeam job, I get an error "Pre-job script terminated with exit code 1 "
"D:\MSSQL\100\DTS\Binn\dtexec.exe /SQL "Maintenance Plans\Admin-Backup" /SERVER OURSERVERNAMEHERE /CHECKPOINTING OFF /SET "\Package\Full.Disable";false /REPORTING E"
I created a batch file and put this command in there and then added it in the Veeam backup setting _ Storage > Advance Settings > Advance tab > Job Scripts - Run the following script before the job.
Does the batch file get copied to the remote server and then run locally in the remote server? or does it execute from the Veeam server?
If I go to the remote server and run this command, it completes successfully. When I run it from the Veeam job, I get an error "Pre-job script terminated with exit code 1 "
-
- Product Manager
- Posts: 20655
- Liked: 2374 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
Go to job settings -> Guest Processing -> Applications -> add corresponding SQL VM -> edit -> scripts -> require successful script execution -> Windows scripts -> set the mentioned script as pre-freeze one. This way, necessary operations will be performed inside VM prior to backup operations. Thanks.
-
- Influencer
- Posts: 24
- Liked: never
- Joined: Jan 27, 2015 9:14 pm
- Full Name: Emil Antonio
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
case 00933477
Is it possible for me to run a script from a remote server that will run a power shell command to execute a Veeam job in my Veeam server? If so, can you please send me a link with examples. Thanks.
Is it possible for me to run a script from a remote server that will run a power shell command to execute a Veeam job in my Veeam server? If so, can you please send me a link with examples. Thanks.
-
- Product Manager
- Posts: 20655
- Liked: 2374 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
Invoke expressions might be your way to go. Thanks.
-
- Influencer
- Posts: 24
- Liked: never
- Joined: Jan 27, 2015 9:14 pm
- Full Name: Emil Antonio
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
v.Eremin
The Invoke-Expressions and Invoke-Command cmdlet only runs the files that are local to the server, right? How do I make it so it can execute a power shell script where the file is located on the remote computer?
Another question: Can I install Veeam PowerShell Snapin in another computer that doesnt have Veeam & Backup software installed? If I can do this, then I can run Veeam cmdlets from the remote computer to execute a Veeam backup job in my Veeam server.
The Invoke-Expressions and Invoke-Command cmdlet only runs the files that are local to the server, right? How do I make it so it can execute a power shell script where the file is located on the remote computer?
Another question: Can I install Veeam PowerShell Snapin in another computer that doesnt have Veeam & Backup software installed? If I can do this, then I can run Veeam cmdlets from the remote computer to execute a Veeam backup job in my Veeam server.
-
- Product Manager
- Posts: 20655
- Liked: 2374 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
Nope, the commands present inside script block will be executed on the remote machine.The Invoke-Expressions and Invoke-Command cmdlet only runs the files that are local to the server, right?
Nope. You can install PS snap-in on the different machine that doesn't have VB&R deployed, but it won't be able to operate with backup server remotely.Another question: Can I install Veeam PowerShell Snapin in another computer that doesnt have Veeam & Backup software installed? If I can do this, then I can run Veeam cmdlets from the remote computer to execute a Veeam backup job in my Veeam server.
Thanks.
-
- Veeam Software
- Posts: 629
- Liked: 251 times
- Joined: Sep 27, 2011 12:17 pm
- Full Name: Craig Dalrymple
- Location: Scotland
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
Apologies for resurrecting an old thread, but I was wonder what credentials/account the script will use on the SQL server ?v.Eremin wrote:Go to job settings -> Guest Processing -> Applications -> add corresponding SQL VM -> edit -> scripts -> require successful script execution -> Windows scripts -> set the mentioned script as pre-freeze one. This way, necessary operations will be performed inside VM prior to backup operations. Thanks.
-
- Product Manager
- Posts: 20655
- Liked: 2374 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
Either general credentials specified under Guest Processing -> Guest OS credentials or individual ones set in "Credentials..." view. Thanks.
-
- Veeam Software
- Posts: 629
- Liked: 251 times
- Joined: Sep 27, 2011 12:17 pm
- Full Name: Craig Dalrymple
- Location: Scotland
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
thanks for the info.
Another question, do I need to copy the batch file to the target SQL server, or does the Veeam job take care of that for me ?
Another question, do I need to copy the batch file to the target SQL server, or does the Veeam job take care of that for me ?
-
- Product Manager
- Posts: 20655
- Liked: 2374 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
VB&R will take care about it; just specify the correct path to the scripts. Thanks.
-
- Veeam Software
- Posts: 629
- Liked: 251 times
- Joined: Sep 27, 2011 12:17 pm
- Full Name: Craig Dalrymple
- Location: Scotland
- Contact:
Re: Is it possible to trigger a Veeam backup job from within
great ..thank you.
Who is online
Users browsing this forum: Google [Bot] and 80 guests