Thanks but the link you sent does not contain any examples, am I missing something?
Yes, I am looking for examples because I cannot get the simplest .bat file to do anything.
Try looking in the Backup Job log to see if it shows anything on why the Script isn’t (seemingly) doing anything. It should be on the VBR Server at:
C:\ProgramData\Veeam\Backup\<job-name>.log
It gives me exactly the same information:
p14.06.2024 23:29:06.557] <01> Warning (3) Pre-job script terminated with exit code 3
Yes, sorry, it should be "Veeam.EndPoint.Manager.exe" but that application is also absent.
It is part of the Agent, not of Backup & Replication it seems.
I run backup jobs on a Backup & Replication server which I connect to external servers to backup, so I’d like to run everything on my local server.
Should I install the agent on the Backup & Replication server for this?
I run Backup & Replication on a Windows 2022 Standard server.
Yes, I installed VBR and not the agent on the Windows 2022 server.
I guess I need to install an agent on this system as well?
Thanks, the agent provided the commandline functionality but this is for the agent. It look like this needs to run on the target system, not on the VBR server.
My idea was to create a single batchfile on the backup server to
- enable the NIC
- connect the VPN to the external server
- run the VBR backup job to backup the external server
- disconnect VPN
- disable the NIC
This to minimize the connection time with the external system.
Therefore I need to run the command for the backup (3.) from the backup server, not the external server.
I would prefer to keep everyting on our local backup server so we can close down the connection when finished. If I run the agent on the remote server I don't know when to close the VPN connection (and disable the NIC).
It is no problem to control LAN and VPN connections to remote servers and back them up, this way we are independent of the remote server and have total, local control. Only thing is that we give the backup job a time window longer than necessary, I'd like to bring that down to the minimum.
Perhaps I can use the build-in powershell interface in VBR to kill the connection as soon as the job is done.
Hmm..well, what you could do is use VBR to ‘push’ an Agent to the remote system, run a few or more backups, see how long it takes, then take the longest time and add additional time then run your script. You can do a pre/post script...although don’t recall if those are available for Agent-based jobs off hand.
Pre/post scripts sounds great, however, a simple batch file syntax containing “cmd.exe” doesn't do anything, Googling this is very discouraging.
Can you point me to some examples?
Yes, I am looking for examples because I cannot get the simplest .bat file to do anything.
Any .bat file I configure as pre script gives errors or hangs without any feedback.
Why is this so complicated...
Cannot get Veeam pre- and postscripting to do anything.
I now applied a Powershell script to do
- enable the NIC
- connect the VPN to the external server
- run the VBR backup job to backup the external server
- disconnect VPN
- disable the NIC
for multiple backup jobs.
This way I only have to use VBR for backing up and have all jobs running in one script independent of Veeam.
Hi @mvandek2 - that’s great to hear you were able to find/create a script which works for you. So, to clarify your process → did you use an Agent job in Veeam Backup? And, you placed your script in the Job settings to have a pre/post-JOB script?
Also, if any of our comments helped you in any way, please don’t forget to select one as ‘Best Answer’ so others with a similar issue who come across your post may benefit.
Best!
I only use VBR and OpenVPN to backup external servers, no agent, however, I see Veeam installing “Veeam Backup Transport” and “Veeam Installer service” being pushed to the remote systems; that's unexpected and a pitty from my perspective (less software is better).
As said, I cannot get pre- and post scripts to work at all, all automation is run via a single Powershell script, fortunately.
The veeamconfig command is for Agent for Linux. You have installed the Agent, correct? I assume you're typing that cmd on your Linux computer? Try typing just veeam instead.
Are you using Agent for Windows or Linux? That will help with determining file locations, but the command files mentioned should be installed even with CE edition.
I run Backup & Replication on a Windows 2022 Standard server.
So you are running the Community Edition of VBR and not the Agent? Or the Agent? Just need clarity to hopefully help further.
Yes, I installed VBR and not the agent on the Windows 2022 server.
I guess I need to install an agent on this system as well?
The link you referenced in your OP is the Agent not VBR so yes. You can deploy the Agent from the VBR console or install it.
Yes, sorry, it should be "Veeam.EndPoint.Manager.exe" but that application is also absent.
It is part of the Agent, not of Backup & Replication it seems.
I run backup jobs on a Backup & Replication server which I connect to external servers to backup, so I’d like to run everything on my local server.
Should I install the agent on the Backup & Replication server for this?
Ok, so everything is just a bit confusing here. If you installed VBR Community Edition, there is no command line, well except for Powershell cmdlets. You use the Veeam Console to start backing up devices. With Community Edition, you have 10 free “instances” you can backup, beit VMs or physical devices. If you don’t want to use VBR to backup physical devices...that is fine..and it sounds like you don’t. You just need to install the Veeam Agent. If you want to backup Linux, Install Veeam Agent for Linux. For Windows, Veeam Agent for Windows. Does that help?
Yes, I installed VBR and not the agent on the Windows 2022 server.
I guess I need to install an agent on this system as well?
You don’t really need Veeam Community Edition installed...just the Agent for Windows if you’re just wanting to backup just that Win 2022 server.
Thanks, the agent provided the commandline functionality but this is for the agent. It look like this needs to run on the target system, not on the VBR server.
My idea was to create a single batchfile on the backup server to
- enable the NIC
- connect the VPN to the external server
- run the VBR backup job to backup the external server
- disconnect VPN
- disable the NIC
This to minimize the connection time with the external system.
Therefore I need to run the command for the backup (3.) from the backup server, not the external server.
Yes has to be on the system you want to back up. If you are looking at backing up remote systems then VBR is the way from this server and you could deploy the Agent to the remote server.
I would prefer to keep everyting on our local backup server so we can close down the connection when finished. If I run the client on the remote server I don't know when the close the VPN connection and (disable the NIC).
Then you would be better off running VBR on the server and deploying the Agent to the remote server. I get the scripting part but it will take longer to fiddle with this part versus going the easy route. You can create a backup job on the VBR server for the Agent including running scripts before/after to accomplish some of the tasks.
It is no problem to control LAN and VPN connections to remote servers and back them up, this way we are independent of the remote server and have total, local control. Only thing is that we give the backup job a time window longer than necessary, I'd like to bring that down to the minimum.
Perhaps I can use the build-in powershell interface in VBR to kill the connection as soon as the job is done.
Yes the PowerShell interface is more powerful and would be something to explore for sure.
Hmm..well, what you could do is use VBR to ‘push’ an Agent to the remote system, run a few or more backups, see how long it takes, then take the longest time and add additional time then run your script. You can do a pre/post script...although don’t recall if those are available for Agent-based jobs off hand.
HI @mvandek2 -
You can run pre/post scripting for Agent jobs only if you use VBR to do the backup of the computer (i.e. Management of the Agent through VBR). See:
https://helpcenter.veeam.com/docs/backup/agents/agent_job_advanced_scripts.html?ver=120
and here:
https://helpcenter.veeam.com/docs/backup/agents/agent_job_vss_scripts.html?ver=120
Doing an Agent for Windows Standalone doesn’t allow pre/post scripting.
You can use any script type… .bat, .ps1, .vbs, etc. Guest processing side scripts only are for guest OS quiescing, so scripting there would be no use for that area of scripting. I think you should be able to do what you want with the Agent Job Scripting though. You'll just need to test it out. The script needs to run on the Backup Server itself, in any location you decide. Then in the Job settings > Storage section > Advanced button, Scripts tab enter the location of the script, as the example shows in the 1st link above.
Hope that helps.
Are you wanting examples of scripts? Veeam doesn't provide examples, just where to place them.