Comprehensive data protection for all workloads
scottyyyc
Influencer
Posts: 12
Liked: never
Joined: Sep 17, 2010 2:10 am
Full Name: Scott R
Contact:

Post Job Activity (script) not launching

Post by scottyyyc »

I have a fairly simple .bat script that I want to run post-job. The script simply robocopies the backup contents to an external HDD.

The script is located in the the C:\Program Files\Veeam directory on the Veeam backup server (Server 08 R2). The "Post Job Activity" checkmark is checked, and the location of the script is in quoations ("C:\Program Files\Veeam\Mirror Backup Drives.bat"). It's set to run every backup cycle.
- The script runs perfectly fine if I launch it manually.
- I currently have it set to run every cycle, it never runs, nor do I receive any kind of error or information in the job log (the job reports it completed successfully).

The Veeam service is running with domain admin credentials, so security shouldn't be an issue. This should be fairly simple... Thoughts?
Vitaliy S.
VP, Product Management
Posts: 27325
Liked: 2778 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Post Job Activity (script) not launching

Post by Vitaliy S. »

Hello Scott,

Even though you account is a domain admin, I would double check that this account is able to run the post backup job script. You may log in with this account to your backup server and trigger the batch file. Besides, as a further step of troubleshooting I would change the user used to run Veeam service to the account which has successfully triggered the batch script.

By the way, do you possibly use any mapped drives in your script?

Thanks!
scottyyyc
Influencer
Posts: 12
Liked: never
Joined: Sep 17, 2010 2:10 am
Full Name: Scott R
Contact:

Re: Post Job Activity (script) not launching

Post by scottyyyc »

Everything is happening under COMPANY\Administrator account. The veeam service is running with these credentials, and this is what I'm logged into the server to test the script with. Everything works when I manually run the script, as I mention.

The script is the following:

Code: Select all

call "C:\Program Files\TrueCrypt\automount_truecrypt.bat"

robocopy w:\ y:\ /MIR /r:3 /w:1

call "C:\Program Files\TrueCrypt\dismount_truecrypt.bat"

powershell.exe .\RoboCopyEmailAlert.ps1
Basically, the script mounts a truecrypt volume, robocopy mirrors the backup contents (W:) to that encrypted container drive (Y:), dismounts the volume, and then runs the powershell script which sends a little email alert that notifies the completion of the task. I suppose the next step I could take in troubleshooting is to add a powershell script at the beginning of the batch file to let me know if the batch is even starting at all?
Vitaliy S.
VP, Product Management
Posts: 27325
Liked: 2778 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Post Job Activity (script) not launching

Post by Vitaliy S. »

Seems like I might know the reason why you observe this behaviour... just to be sure that I'm right, try replacing your script with a simple script that just creates a text file on a system drive. Please let me know how it works for you.
scottyyyc
Influencer
Posts: 12
Liked: never
Joined: Sep 17, 2010 2:10 am
Full Name: Scott R
Contact:

Re: Post Job Activity (script) not launching

Post by scottyyyc »

Sorry about the late response Vitaliy. I'll be trying this with tonight's job. I have a simple test.bat that is set to run. The batch file simply contains "echo Hello world! >> "new text document.txt".I'll report back tomorrow.
scottyyyc
Influencer
Posts: 12
Liked: never
Joined: Sep 17, 2010 2:10 am
Full Name: Scott R
Contact:

Re: Post Job Activity (script) not launching

Post by scottyyyc »

My nightly job just finished. The script did not run (text file was not created). Re-confirmed that it was set to run, everything looks normal. Thoughts?
Vitaliy S.
VP, Product Management
Posts: 27325
Liked: 2778 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Post Job Activity (script) not launching

Post by Vitaliy S. »

Have you tried playing with Veeam Backup service account? Previously I had two ideas about script not being triggered... one was that service account doesn't have enough permissions to access/trigger the script, another one was related to mapped drives used in the script, as you know mapped drives can only be used while you're logged to the machine interactively.
EBoucq
Service Provider
Posts: 268
Liked: 18 times
Joined: Jan 21, 2011 10:10 am
Full Name: Eric Boucq
Contact:

Running a script at the end of a job

Post by EBoucq »

[merged]

Hi,

Is there some kind of trick to run a script when a job ends ?
My .bat works when I run it manually. There's no message in Veeam but the job doesn't start the script once the backup is complete.
Thanks.
Eric
nehalem
Influencer
Posts: 12
Liked: never
Joined: Dec 02, 2010 7:16 pm
Full Name: Kiriakos Ntolias
Contact:

Post job activity command doesnt work

Post by nehalem »

[merged]

Hello team,

My question is very simple, i want to control 3 backup jobs (without schedule) just to start each one after another.
I am scheduling only the first backup job to start at midnight, on this job i have entered on the advanced settings
on the Post job activity command, the command line that executes the second job, i have take the exact command line
from the summary of the second job and it is has a syntax like that

Code: Select all

"C:\Program Files\Veeam\Backup and Replication\Veeam.Backup.Manager.exe" backup 67491580-e9d3-4062-ae0f-8e99dd716f3a
this is exactly what i am pasting in the text box of the Post job activity command
it runs well, it starts exactly after the previous first job finishes
i am repeating the same steps for the jobs 2 to 3 and the run completes quite well

BUT

in the 3rd job, i don't want to execute a loop (re-run the fisrt job) so i am trying to execute a custom command
entering a .bat or .cmd file that contains a command for robocopy (sync backup files to another location)

every other command (except than i tryied to execute was just ignored by the 3rd backup task
i tried simple tests, i browsed and pointed a .bat, a .cmd an .exe file ... just for fun to open notepad.exe, even typed the direct the command
with the same syntax as veeam backup prepares its commands in summary window

nothing executed nothing happens :x

the first question is simple

what do i have to enter in this box if i want to run a batch file or an exe, other than Veeam.Backup.Manager.exe :roll:

and a second question is

can i control this execution by the result of job, i mean, execute if job complete success or don't execute if the job complete as failed

Give me the light :idea: ... thanks
Pierrot97
Lurker
Posts: 1
Liked: never
Joined: Aug 31, 2011 4:09 pm
Full Name: Pierrot
Contact:

Re: Post Job Activity (script) not launching

Post by Pierrot97 »

Hi scottyyyc,

Your problem is solve or not ?
JorisK
Enthusiast
Posts: 58
Liked: never
Joined: Jan 01, 2006 1:01 am

Post-job does not work properly

Post by JorisK »

[merged]

Hi,

What is the best practise to start another job using the "post job" setting?
I have a lot of backup jobs and about five of them are scheduled. Once the scheduled job is done it starts a batch file containing the command to start the next "sub-job". This way i make sure i'm only running five jobs at the same time.

The problem is, that often this does not work, i don't know why. The batch jobs contain a correct script since the job does start when i copy/past the content of the post-job setting in my start/run.

Should i use batch files to launch other jobs?

Anyone?
Gostev
Chief Product Officer
Posts: 31707
Liked: 7212 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Post-job does not work properly

Post by Gostev »

Hi, well, it's really up to you... you can use any option you like - batch files, PowerShell script is another popular choice, or have our support investigate what you are doing wrong with post-job, and use that. They will all produce the same result, so I am not really sure if I understand what advise are you looking to get. Thanks.
JorisK
Enthusiast
Posts: 58
Liked: never
Joined: Jan 01, 2006 1:01 am

Re: Post-job does not work properly

Post by JorisK »

Good to find it that using batch files should be working.

My problem is: it does not work. When i'm logged on to my backup console and i see my job finish, nothing happens. No batch file gets started to launch the next job. When i manually copy/past the content of the post-job field in my Start/Run the job does start.
iroche
Enthusiast
Posts: 30
Liked: never
Joined: May 20, 2011 8:27 am
Full Name: Ian Roche
Location: Ireland
Contact:

Re: Post-job does not work properly

Post by iroche »

JorisK wrote:Good to find it that using batch files should be working.

My problem is: it does not work. When i'm logged on to my backup console and i see my job finish, nothing happens. No batch file gets started to launch the next job. When i manually copy/past the content of the post-job field in my Start/Run the job does start.

I use this functionality allot to call Backup Exec tape jobs and it works fine. What are you trying to do exactly ? what format is the job (batch file or whatever). I generally use batchfiles I store them in a directory on the backup server and point to each bact file in the "Post job activity" section.
JorisK
Enthusiast
Posts: 58
Liked: never
Joined: Jan 01, 2006 1:01 am

Re: Post Job Activity (script) not launching

Post by JorisK »

OK i found out the problem and solution:

When i check "Run the following command", browse to my batch file and select "Run on selected days only" (and select the days the command should run) the batch file does not launch after the backup. When i change the option to "Run every 1 backup cycle" it does launch and everything works properly.

Somehow the option "Run on selected days only" does not work. My time/date is configured correctly. Version of VEEAM is the latest.
Gostev
Chief Product Officer
Posts: 31707
Liked: 7212 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Post Job Activity (script) not launching

Post by Gostev »

May be your job ends in the different (next) day after the one you have selected? Just an idea. Our support can tell you the exact reason from the logs.
JorisK
Enthusiast
Posts: 58
Liked: never
Joined: Jan 01, 2006 1:01 am

Re: Post Job Activity (script) not launching

Post by JorisK »

Gostev wrote:May be your job ends in the different (next) day after the one you have selected? Just an idea. Our support could tell you the exact reason from the logs.
It even does not work when i select all days. And the job finishes in just 30 minutes on a day that is selected so this seems not the issue.
indyjake
Novice
Posts: 6
Liked: never
Joined: Oct 30, 2009 1:56 pm
Full Name: Jake
Contact:

Re: Post Job Activity (script) not launching

Post by indyjake »

Hello, I was curious to know if you had made any progress on this issue. I find that I have this issue intermittently when I have a post-job command set to run on specific days. It runs on some of the days I have it set to run, but other days it doesn't. However, when I have it set to run after every 1 backup cycle, it consistently works.
Vitaliy S.
VP, Product Management
Posts: 27325
Liked: 2778 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Post Job Activity (script) not launching

Post by Vitaliy S. »

Hello Jake, is there anything special in your post-backup job script? Has our support team found anything in your log files? Thanks!
indyjake
Novice
Posts: 6
Liked: never
Joined: Oct 30, 2009 1:56 pm
Full Name: Jake
Contact:

Re: Post Job Activity (script) not launching

Post by indyjake »

Hi Vitaliy, it's a simple batch file job that kicks of my BackupExec job to get my vbk's on tape. I haven't opened a support ticket with Veeam yet. I was hoping for an easy answer from the forums first ;) but it looks like it may not be here. I'm going to do some more testing and then open a ticket if I can't get it sorted out.
arsprod
Enthusiast
Posts: 86
Liked: never
Joined: Jan 21, 2011 6:09 pm
Full Name: Aaron Spiegel
Contact:

batch files not running

Post by arsprod »

[merged]

I have some very simple batch files that I want to run after vm backups to start robocopy. They're all set in the advanced settings/advanced/post job activity/run the following command. None are running on their own - am I missing something? Thanks,

Aaron
nehalem
Influencer
Posts: 12
Liked: never
Joined: Dec 02, 2010 7:16 pm
Full Name: Kiriakos Ntolias
Contact:

Run Post Job Script on remote proxy (Tape Offsite backup)

Post by nehalem »

[merged]

In version 5 we are using 3 different Veeams to spread the load and each one veeam server has installed a tsm agent to move its VBKs/VIBs to tape.
After each job finishes a local .bat as post job script executes and moves the fresh backups to tape, it is must that the script must run on the same machine that exists the data, so with Version 5, each veeam has its own jobs and settings to "fire up" the tsm script.

We are about to upgrade to v6 soon and we are looking the exact same scenario but as the topology differences we plan to have one master Veeam 6 server holding all the catalog/jobs
and also we are gonna use 2 additional proxies and repositories to spread the load (about 120VMs)

The actual problem is that we are setting the job and the post scripts on the master veeam, but the command executes in the master veeam and the script concerns the proxy veeam and its data. We tried a lot of things, actually we build scripts with psexec to execute the command on the remote machine and while when we are running it manually from the command line os master veeam it does the firing job on the remote machine, but when put this .bat or .cmd on the advanced settings "post command" no action is taken on the remote proxy to start moving to tape.
To test if the script is running or not at all, we added a command to make a .txt file locally before the psexec command, an the file created.

Is there any way to do this?
ThomasMc
Veteran
Posts: 293
Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Post Job Activity (script) not launching

Post by ThomasMc »

There's a post around here somewhere but I can't find it, even though I posted in it at one time :)


Anyhoo Powershell is your friend with this sort of thing.
Veeam and Remote BE

This will give you a rough idea on how to do it, or start a new thread in the Powershell section of the forums if you require assistance as I don't venture out of there much these days :D
Dave-Departed
Expert
Posts: 167
Liked: 6 times
Joined: Feb 29, 2012 3:11 pm
Contact:

[MERGED] Post-job action not running [00170979]

Post by Dave-Departed »

Hi All,

Putting in place the workaround for backing up Fault Tolerance-enabled VMs (scheduled Windows task to turn off FT via CLI before Veeam job begins, and then use Veeam post-job action to re-enable FT). The Windows scheduled task works fine, and the batch file to restart the FT works fine, but the Veeam job does not appear to run the batch file upon completion of the job. Does anyone know why, please?

Thanks

Dave
johntnavi
Enthusiast
Posts: 27
Liked: 1 time
Joined: Apr 27, 2012 6:55 pm
Full Name: John T
Contact:

[MERGED] Post Backup Script Not Running

Post by johntnavi »

Just configured Symantecs Evault but having a problem with the Post Job Script Running:

powershell.exe c:\scripts\postEVbackup.ps1

Do I need to use the full path for powershell? Is there any logging available to see where the job failed?

john
massimiliano.rizzi
Service Provider
Posts: 213
Liked: 27 times
Joined: Jan 24, 2012 7:56 am
Full Name: Massimiliano Rizzi
Contact:

[MERGED] Troubleshooting a post-backup action not being exec

Post by massimiliano.rizzi »

Hello,

as part of building a new Veeam Backup & Replication 6.5 backup job from scratch, we selected the “Run the following command” check box to execute a post-backup action (after every backup cycle) to launch a SyncBack profile mirroring the contents of the backup repository located on a NAS to a removable RDX device (I've done it multiple times over the last months).

If I barely copy the post-backup action script to a command prompt and start it manually everything works fine, however it seems that the post-backup action itself is not started automatically.

Any help/information will be greatly appreciated.

Thanks and Regards,

Massimiliano
veremin
Product Manager
Posts: 20353
Liked: 2285 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Post Job Activity (script) not launching

Post by veremin »

Do I need to use the full path for powershell? Is there any logging available to see where the job failed?
Try to specify the following line as the post job activity and see whether it works:

Code: Select all

powershell.exe –file c:\scripts\postEVbackup.ps1
Hope this helps.
Thanks.
veremin
Product Manager
Posts: 20353
Liked: 2285 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Post Job Activity (script) not launching

Post by veremin »

@Massimiliano

Long story short, things that need to be checked:

1) The after-job will run with the permissions of the Veeam service account. So, firstly verify if the account specified as Veeam Service one is able to run the script.

2) Even if this account is Domain Admin, it might be worth adding it to the local Administrators group. Although the Domain Admin account resides in the Domain Admin group, which, in turn, resides in the local Administrators group, sometimes it is not enough to make it work.

3) Furthermore, If you set your script as a scheduled task rather than through Veeam do you get the same problem? In other words, please test whether it can be executed by the means of Windows Scheduler.

Hope this helps.
Thanks.
aitorabad
Lurker
Posts: 1
Liked: never
Joined: Apr 25, 2012 4:51 pm
Contact:

[MERGED] Post job activity only running once (Case 00256752)

Post by aitorabad »

Case details:

- Backup job scheduled to run every 1 hour from Monday to Sunday.
- Post job activity setup:
"Run the following command:" C:\Scripts\test.bat
"Run on selected days only" checked and "Sunday" selected.

The first time the job is executed on Sunday the command is executed as expected. Log entries:
[26.06.2013 11:31:11] <01> Info Running post job command
[26.06.2013 11:31:11] <01> Info Executing custom command '"C:\Scripts\test.bat"', arguments ''

Next times the job is executed on Sunday the command is not executed. Log entries:

[26.06.2013 11:41:34] <01> Info Running post job command
[26.06.2013 11:41:34] <01> Info Skip custom command execution. Job run 1 of 0.

Does anybody know why is it running only once? I expected the command to be run every time the job finish (on Sunday only).

Thanks in advance. Best regards.
foggy
Veeam Software
Posts: 21128
Liked: 2137 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Post Job Activity (script) not launching

Post by foggy »

I've just discussed this with our QC and this behavior is addressed in v7 - post-job activity will be launched on each job run on the particular day, if scheduled to run on that day.
Post Reply

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], Google [Bot], merrill.davis, Semrush [Bot] and 43 guests