Comprehensive data protection for all workloads
Post Reply
tfloor
Expert
Posts: 270
Liked: 14 times
Joined: Jan 03, 2012 2:02 pm
Full Name: Tristan Floor
Contact:

Batch file with commandline jobs

Post by tfloor »

Hi,

Is it possible to create a commandline batch file, with the Job commandlines inside, while each job is waiting for each other before going to the next line of the batch file?

So first: D:\Apps\Veeam\Backup and Replication\Veeam.Backup.Manager.exe" backup dcd93df2-b4a7-4f3f-9bb5-ab3177aabb51
ANd if that job is finished the batch file is going further to
D:\Apps\Veeam\Backup and Replication\Veeam.Backup.Manager.exe" backup dcd93df2-b4a7-4f3f-9bb5-ab317sdfsdfj239

Now everything is running immediatly...I don't want that

Thanks

foggy
Veeam Software
Posts: 19553
Liked: 1785 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Batch file with commandline jobs

Post by foggy »

Actually, you do not need a batch file to chain the jobs, but can use post-job activity setting instead (add each new job as a post-job command (Edit Backup Job > Storage > Advanced > Advanced) to the previous job).

Vitaliy S.
Product Manager
Posts: 24353
Liked: 1897 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Batch file with commandline jobs

Post by Vitaliy S. »

I believe it should be quite easy with PowerShell, see existing thread on that: Veeam Backup v4 wait command (nevermind the title)

tfloor
Expert
Posts: 270
Liked: 14 times
Joined: Jan 03, 2012 2:02 pm
Full Name: Tristan Floor
Contact:

Re: Batch file with commandline jobs

Post by tfloor »

foggy wrote:Actually, you do not need a batch file to chain the jobs, but can use post-job activity setting instead (add each new job as a post-job command (Edit Backup Job > Storage > Advanced > Advanced) to the previous job).
That's not enough.
I have a lot of commands after each other to complete the backup flow.
- veeam jobs
- archive bit resets
- backup exec jobs.

:)

foggy
Veeam Software
Posts: 19553
Liked: 1785 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Batch file with commandline jobs

Post by foggy »

Then you should definitely go with PowerShell.

tfloor
Expert
Posts: 270
Liked: 14 times
Joined: Jan 03, 2012 2:02 pm
Full Name: Tristan Floor
Contact:

Re: Batch file with commandline jobs

Post by tfloor »

foggy wrote:Then you should definitely go with PowerShell.
that's something i have to learn!.... so no ready togo script for me.
I like powershell, but i have to still learn it.
Thanks.

foggy
Veeam Software
Posts: 19553
Liked: 1785 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Batch file with commandline jobs

Post by foggy »

Try to search, I think you can find some samples here.

ISExpress
Influencer
Posts: 16
Liked: never
Joined: Jun 27, 2011 1:50 pm
Full Name: ISExpress
Contact:

Re: Batch file with commandline jobs

Post by ISExpress »

Hi

We have recently upgraded our Backup Exec environment from 2010 to 2012. We use Veeam and do reversed incremental jobs. We run 4 Veeam jobs in total and in one of the Jobs (the last job that runs) I have setup a post job activity for it to run a bat file on the c:\ drive but once the veeam job finishes it fails to run the bat file.

Is there any way I can find out through log files why it doesnt run?
If I run the bat file manually it runs fine. The bat file is basically a command to run Powershell and run a powershell command to kick of a job in Backup Exec 2012 (which now utilises powershell rather than traditional command line).

In the Bat file it contains the following:

c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe start-bejob -i '"SymantecBackupjobname"' -confirm:$false

Also in powershell I have imported the module which Symantec uses to run powershell commands. If I run this command manually it works without any issue.

I think a few other Veeam uses also use Backup exec, it be interesting to know if these same users have upgraded to Backup Exec 2012 and use veeam post job option...

Any advice would be appreciated. I will also log this on the symantec forum to see if they can help.

Thanks

Vitaliy S.
Product Manager
Posts: 24353
Liked: 1897 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Batch file with commandline jobs

Post by Vitaliy S. »

Did this script run successfully prior to your upgrade of BE environment?

If this is the first time you use this script, please look through this topic, might help: Post Job Activity (script) not launching

ISExpress
Influencer
Posts: 16
Liked: never
Joined: Jun 27, 2011 1:50 pm
Full Name: ISExpress
Contact:

Re: Batch file with commandline jobs

Post by ISExpress »

Hi

Yes I just looked at the file and the way that was resolved was by running the command as "run every 1 backup cycle". THe problem with this is it will run every day and I only need it to run this file Monday to Saturday as we dont back to tape on a Sunday but we do run the Veeam backup.

Vitaliy S.
Product Manager
Posts: 24353
Liked: 1897 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Batch file with commandline jobs

Post by Vitaliy S. »

Hmm...so you're saying the script is not triggered when you choose to run in on specific days? That's not expected and I would recommend to show this behavior to our support team.

Post Reply

Who is online

Users browsing this forum: DRoN and 38 guests