Comprehensive data protection for all workloads
chad156
Enthusiast
Posts: 30
Liked: 1 time
Joined: Mar 22, 2012 3:35 pm
Full Name: Chad Gibson
Contact:

[MERGED] Post Job Batch File

Post by chad156 »

I have a nightly backup job that runs. I have added a post job script to simply run a batch file.
The batch file runs psexec and call becmd on another physical server with BE and a tape drive.
If I run the batch file from the Veeam server, it works no problem.
If I add the batch file to the post job scripting and schedule to run every night, I get no results.

I tried support, but they cannot help with post job scripting.

Can someone point me in the proper direction to get the post job script to run? Bat files not supported and needs done with powershell? Anything along those lines?

Any help is appreciated.

Thanks
-Chad
foggy
Veeam Software
Posts: 21133
Liked: 2140 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Post Job Activity (script) not launching

Post by foggy »

Chad, you've been merged into existing discussion regarding your issue. Please kindly review the suggested solutions and feel free to ask any additional questions, should they arise. Thanks.
chad156
Enthusiast
Posts: 30
Liked: 1 time
Joined: Mar 22, 2012 3:35 pm
Full Name: Chad Gibson
Contact:

Re: Post Job Activity (script) not launching

Post by chad156 »

Thanks for the merge...so reading back thru, looks like there is no solution to this issue. The only thing ive found is "this should be addressed in v7"

Thats correct?
foggy
Veeam Software
Posts: 21133
Liked: 2140 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Post Job Activity (script) not launching

Post by foggy »

Actually, not. Most likely the issue is in Veeam Backup service account credentials used to run the script or in using mapped drives in the script. Could you please check if one of these is the case?
chad156
Enthusiast
Posts: 30
Liked: 1 time
Joined: Mar 22, 2012 3:35 pm
Full Name: Chad Gibson
Contact:

Re: Post Job Activity (script) not launching

Post by chad156 »

The veeam service account is the same domain account i'm using to log in and run the bat file manually with. I ran it in task scheduler no problem, it runs just fine. There are no mapped drives in the script.

Its a simple bat file, it just wont launch at the end of the job.

psexec \\servername -u sameusername -p samepassword "c:\Program Files\Symantec\Backup Exec\bemcmd.exe" -o1 -jVeeamToTape
chad156
Enthusiast
Posts: 30
Liked: 1 time
Joined: Mar 22, 2012 3:35 pm
Full Name: Chad Gibson
Contact:

Re: Post Job Activity (script) not launching

Post by chad156 »

hmmm....staring at that, let me try something else.
chad156
Enthusiast
Posts: 30
Liked: 1 time
Joined: Mar 22, 2012 3:35 pm
Full Name: Chad Gibson
Contact:

Re: Post Job Activity (script) not launching

Post by chad156 »

Not sure i've made any headway, its set for tonight, i'll post back my results.
chad156
Enthusiast
Posts: 30
Liked: 1 time
Joined: Mar 22, 2012 3:35 pm
Full Name: Chad Gibson
Contact:

Re: Post Job Activity (script) not launching

Post by chad156 »

So I changed it to not run daily, that doesn't seem to work, but to the first option after every cycle....now its running the backup exec job after the completion of every server!?! So one job, that has 9 servers, is kicking off the backup job after every server. I thought it was to run at job completion?
veremin
Product Manager
Posts: 20382
Liked: 2294 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Post Job Activity (script) not launching

Post by veremin »

Yep, definitely it’s not something expected, since it’s a “job run” that is understood by a “backup cycle”. So, I'd suggest you to open a ticket with our support team and let them investigate it directly.

Thanks.
chad156
Enthusiast
Posts: 30
Liked: 1 time
Joined: Mar 22, 2012 3:35 pm
Full Name: Chad Gibson
Contact:

Re: Post Job Activity (script) not launching

Post by chad156 »

Round and round....I started there, I never bring anything to forum with going thru support first. They said go to the forum, forum says go to support.
veremin
Product Manager
Posts: 20382
Liked: 2294 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Post Job Activity (script) not launching

Post by veremin »

Please, be aware that the team behind this community isn’t the one responsible for log investigation, etc., and cannot assist you effectively with specific technical issues via forum correspondence. Actually, we have it in our forum rules that can be seen while creating New Topic.

And if you’re not satisfied with a help given by a support representative, you can always ask to escalate your case.

Thanks.
foggy
Veeam Software
Posts: 21133
Liked: 2140 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Post Job Activity (script) not launching

Post by foggy »

Chad, what is your case number then? I really doubt that support could send you to the forums to resolve a technical issue. What they probably told you is that they cannot write and troubleshoot scripts, but that is not the case with your particular issue, where the script is not even started. This kind of technical issues should be addressed to support and get resolved there. We always encourage customers to contact support directly if they have some kind of a technical issue.
chad156
Enthusiast
Posts: 30
Liked: 1 time
Joined: Mar 22, 2012 3:35 pm
Full Name: Chad Gibson
Contact:

Re: Post Job Activity (script) not launching

Post by chad156 »

Doubt all you want, yes they did. I never had an issue with the script it was with the day vrs cycle of running the script. I've learned to never start a tech nically issuein the forum. I always start with support.
foggy
Veeam Software
Posts: 21133
Liked: 2140 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Post Job Activity (script) not launching

Post by foggy »

Then I encourage you to escalate the case to get proper assistance.
Tijz
Service Provider
Posts: 34
Liked: 4 times
Joined: Jan 20, 2012 10:03 am
Full Name: Mattijs Duivenvoorden
Contact:

Re: Post Job Activity (script) not launching

Post by Tijz » 1 person likes this post

I had the same issue. Or at least, I had an issue where my script as configured in post job activity wouldn't start.

Luckily in my case I got it working. In my case it had to do with the "start in" directory. One would expect the script to be run from the directory it's located in. But it's NOT! I used relative paths in my script, that's why it didn't work. When I changed all my paths to absolute paths, it did work.

So even to test if the script run, I added a line like "echo hello!? > log.txt"
But there was no file log.txt being created. At least, NOT in the directory where I expected it (the same dir as the script).

It took me some time because Veeam GUI does not mention the running of post job scripts at all. I would expect there to be a mention in the job log (in the GUI). So at first it seemed that the script was just not called by Veeam.
But when I looked into the joblogs themselves (in C:\programdata\veeam), I saw that the script WAS actually called.
foggy
Veeam Software
Posts: 21133
Liked: 2140 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Post Job Activity (script) not launching

Post by foggy »

Mattijs, thanks for sharing. This also could be the reason of the script launch failure.
feelgood
Novice
Posts: 3
Liked: 1 time
Joined: Nov 13, 2013 8:18 am
Full Name: Michael Kaulard
Contact:

Re: Post Job Activity (script) not launching

Post by feelgood »

I had a very similar situation as those described above: Wrote a batch to copy the files to another local folder after backup periodically.
The batch runs and produces a .log-file when started manually, but not as a "post job activity" "run on selected days only".
I created a local Admin-Account under which all Veeam-Services run. Batch did not run.
I didn't use mapped drives, only absolute paths to local internal hard drives on the machine.

BUT: It runs when I click "Run every " "1" backup cycle. So: this looks like an issue to me (Veeam Version 7.0.0.690 ForumAdmins: feel free to remove this posting if you decide to fix it).

Workaround for me: I want to copy the vbk-file on weekends to a second location, so I put the date identification into the batch file and let it launch every 1 backup cycle.
foggy
Veeam Software
Posts: 21133
Liked: 2140 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Post Job Activity (script) not launching

Post by foggy »

Michael, sorry for the late reply, but were you able to nail this down? Is there a chance that the script did not run in case of the "Run on selected days only" option selected just because it had already run before on the same day (when the second option was selected)? What I mean here is that if the script was already launched once during the day, it would not be run again with the "Run on selected days only" option (i.e. it runs only once on the specified day, regardless of how many times the job is started).
friadent
Lurker
Posts: 2
Liked: never
Joined: May 02, 2012 9:29 am

Re: Post Job Activity (script) not launching

Post by friadent »

I have a similar problem: I have reconfigured a Backup Job to run a post Job activity on Saturdays. The Job started on Friday and Ends on Saturday. The post command did not run. I found this in the logfile:
[22.02.2014 20:42:07] <01> Info Running post job command
[22.02.2014 20:42:07] <01> Info Skip custom command execution. Job run 0 of 0.

This was the first and only run of this Job on this day. Why is the command execution skipped?

I have tested the command with a test Job and it is working once on the selected day, so it isn't an account issue.
foggy
Veeam Software
Posts: 21133
Liked: 2140 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Post Job Activity (script) not launching

Post by foggy »

friadent wrote:I have a similar problem: I have reconfigured a Backup Job to run a post Job activity on Saturdays. The Job started on Friday and Ends on Saturday.
Select Friday instead of Saturday in the script schedule. The job start time is taken into account when checking whether the script should run.
namiko78
Expert
Posts: 117
Liked: 4 times
Joined: Mar 03, 2011 1:49 pm
Full Name: Steven Stirling
Contact:

[MERGED] Post Job Command - start day or end day?

Post by namiko78 »

I am setting up post job commands, to only run on certain days. Some of my jobs span into the next day. What should i be setting, the day the job starts or the day it actually ends?
maybe a silly question but i don't want to wait until the jobs don't work properly to find out :)

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

Re: Post Job Activity (script) not launching

Post by foggy »

Steven, please see my last reply above.
veremin
Product Manager
Posts: 20382
Liked: 2294 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: [MERGED] Post Job Command - start day or end day?

Post by veremin »

Also, you add auditorial part to the begining of the post-job script. This part will check what current day is, and perform or won't perform further commands accordingly. Thanks.
markinsocal
Novice
Posts: 9
Liked: 3 times
Joined: Jul 21, 2014 6:23 pm
Full Name: Mark

Re: Post Job Activity (script) not launching

Post by markinsocal »

This thread is old but I had the issue where it appeared the script wasn't running. I did everything mentioned in this thread. The very last thing I did was put the full path to robocopy.exe in my batch file, and use UNC path (\\myserver\myshare) in the robocopy command, instead of mapped drive letters. FYI: the logs are in c:\programdata\JobName. I wish these were accessible through GUI.
Vitaliy S.
VP, Product Management
Posts: 27357
Liked: 2788 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Post Job Activity (script) not launching

Post by Vitaliy S. »

Hi Mark, thanks for sharing. As to the logs, then they are accessible via GUI, to launch job collection wizard, select Help > Support Information from the main menu.
andreasaster
Influencer
Posts: 13
Liked: 2 times
Joined: Dec 24, 2014 8:40 am
Contact:

[MERGED] Post script on selected days

Post by andreasaster »

Hi,

I did not find somting about in the help. When I select to run a post script on selected days, which time count for calculating the selected day? The start time of the job or the time, the script gets executed?
I would launch a script only on the thursday backup, but sometimes the backup finishes a few minutes before midnight, sometimes a few minutes after.

Thanks
Regards,
Andreas
foggy
Veeam Software
Posts: 21133
Liked: 2140 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Post Job Activity (script) not launching

Post by foggy » 1 person likes this post

Andreas, post job command is launched based on the job start date. Thanks.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 78 guests