Pre-job script terminated with exit

Everything about backing up to tape

Pre-job script terminated with exit

Veeam Logoby bsoosay » Thu Jul 30, 2015 12:48 pm

Hi!

I'm trying to run a tape to file job. The server that I intend on using the tape to file job has been added to the Backup Infrastructure tab.

Now before the backup job runs, I need a script to run that renames certain files on my target server and then rename it back to the original after the backup is done.

I have placed these scripts on the target server and shared the folder and given full rights to the same account running the tape to file job.

In the Advanced tab of the tape to file job, I keyed in the path of the script as: \\10.60.15.13\Veeam_Scripts\changedoc.cmd

Now the moment I execute this job, I receive an error : Pre-job script terminated with exit code 1

What am I doing wrong, and what does this error message mean? How do I get Veeam Backup and Replication to execute that script on my target server prior to the backup and upon completion of the backup.
bsoosay
Enthusiast
 
Posts: 34
Liked: never
Joined: Thu Oct 02, 2014 7:47 am
Full Name: Benjamin Soosay

Re: Pre-job script terminated with exit

Veeam Logoby v.Eremin » Thu Jul 30, 2015 12:59 pm

What particular commands are you using as pre-job command? Being command specific, error codes might have different meanings. Thanks.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Pre-job script terminated with exit

Veeam Logoby PTide » Thu Jul 30, 2015 12:59 pm

Hi,

Have you tried placing the script in a local folder of your B&R server? Why to place it on a shared folder?

VB&R just outputs exit code received from an executed command.

Thank you.
PTide
Veeam Software
 
Posts: 3021
Liked: 246 times
Joined: Tue May 19, 2015 1:46 pm

Re: Pre-job script terminated with exit

Veeam Logoby bsoosay » Thu Jul 30, 2015 1:08 pm

I'm placing the script on the target folder because its suppose to change files on the target folder.

This is the script:

forfiles /p E:\Folder\Daily\ /s /m "*.doc" /c "cmd /c Ren @fname.doc *.olddoc" /d -03


When I run this script manually from the target server...it works perfectly. In fact, I used to use a different backup software and I used to run this same script from the target server, without any issues.

Why can't it work with Veeam?
bsoosay
Enthusiast
 
Posts: 34
Liked: never
Joined: Thu Oct 02, 2014 7:47 am
Full Name: Benjamin Soosay

Re: Pre-job script terminated with exit

Veeam Logoby PTide » Thu Jul 30, 2015 2:56 pm

Wait a second...

Where is your E:/Folder/Daily folder located? On backup server or on 10.60.15.13 ?

Thank you.
PTide
Veeam Software
 
Posts: 3021
Liked: 246 times
Joined: Tue May 19, 2015 1:46 pm

Re: Pre-job script terminated with exit

Veeam Logoby bsoosay » Thu Jul 30, 2015 11:43 pm

E:/Folder/Daily folder located?

Its located on the 10.60.15.13 (which is the target server)
bsoosay
Enthusiast
 
Posts: 34
Liked: never
Joined: Thu Oct 02, 2014 7:47 am
Full Name: Benjamin Soosay

Re: Pre-job script terminated with exit

Veeam Logoby PTide » Mon Aug 03, 2015 12:27 pm

Your pre-job script is trying perform all actions specified on your backup server, i.e. it tries to locate E:/Folder/Daily on your backup server. Here are some advices:

1) It is no use keeping scripts on your target. Keep them on your backup server.

2)
forfiles /p E:\Folder\Daily\ /s /m "*.doc" /c "cmd /c Ren @fname.doc *.olddoc" /d -03
In order to make your script work you'll have to either:
a) specify a UNC (\\TARGET_NAME\shared\folder\) path to a shared folder instead of E:\Folder\Daily\ (don't forget about r/w permissions)
b) modify your script in such way that it starts some remote script/gets executed on a remote machine (psexec can do the job).

However, I'd better stick to option "b" in order to eliminate the shared folder from the schema completely.

Thank you.
PTide
Veeam Software
 
Posts: 3021
Liked: 246 times
Joined: Tue May 19, 2015 1:46 pm

Re: Pre-job script terminated with exit

Veeam Logoby alanwilliams » Thu Feb 25, 2016 9:11 pm

So I was referred to this article by your Veeam Support Team as a solution to my problem. If I understand this post correctly, if you need to execute code(script) on the guest(target) machine pre and post backup, you need to execute a remote PowerShell command to execute on the target machine? The target machine utilizes Custom PowerShell for Enterprise Vault in order for the pre and post commands to run. Initially, I was told the scripts were"uploaded" to the target workstation and then executed, which I'm finding not to be the case here. So to be specific, the scripts execute on the Veeam management server and you need to target the guests accordingly in your script, which is more difficult...
alanwilliams
Novice
 
Posts: 4
Liked: never
Joined: Thu Feb 25, 2016 5:56 pm
Full Name: Alan B. Williams

Re: Pre-job script terminated with exit

Veeam Logoby alanbolte » Thu Feb 25, 2016 9:13 pm

Pre-freeze and post-thaw scripts in the guest processing settings of a VM backup job are uploaded to the VM being processed. Any other script is executed on the Veeam backup server.
alanbolte
Expert
 
Posts: 635
Liked: 170 times
Joined: Mon Jun 18, 2012 8:58 pm
Full Name: Alan Bolte

Re: Pre-job script terminated with exit

Veeam Logoby alanwilliams » Thu Feb 25, 2016 10:19 pm

To confirm a minor detail, Pre-freeze and post-thaw scripts have to be in .bat form?
alanwilliams
Novice
 
Posts: 4
Liked: never
Joined: Thu Feb 25, 2016 5:56 pm
Full Name: Alan B. Williams

Re: Pre-job script terminated with exit

Veeam Logoby v.Eremin » Fri Feb 26, 2016 11:30 am

To confirm a minor detail, Pre-freeze and post-thaw scripts have to be in .bat form?

Exe and ps1 files can be also used. Though, in latter case (.ps1) some dirty tricks might be required. Thanks.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to Tape



Who is online

Users browsing this forum: No registered users and 7 guests