Highlighted
Contributor.. Contributor..
Contributor..
153 views

Question about backup

Hi,

I have one simple question Post-exec/pre-exec scripts.

The question is can I configure so that the backup still continue to run, regardless of the status of the pre/post-exec script failed/succed?

Even if the script fails/timeout, the backup will still continue to run.

Thank You

0 Likes
3 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Question about backup

Hello @Luqman12

When you configure the script, in the backup options part, add the script name like this: 
utilns/detach -com script.bat

This will allow the script to run, and independent of the result, the backup will run. 

Victor_F_DP_0-1581604911177.png

Regards, 

Andres Fallas Salazar
Customer Support Engineer

If you find that this or any other post resolves your issue, please be sure to mark it as an accepted solution.
If you are satisfied with anyone’s response please remember to give them a LIKE by clicking on the bottom at the left of the post and show your appreciation.
Contributor.. Contributor..
Contributor..

Re: Question about backup

Hi I have this following error

[Normal] From: BSM@test.biz "FS_ProdSM_Daily_Full" Time: 14/2/2020 11:32:46 AM
Backup session 2020/02/14-3 started.

[Normal] From: BSM@test.biz "FS_ProdSM_Daily_Full" Time: 14/2/2020 11:32:46 AM
Starting to execute "utilns/detach -com test script.bat"...

[Warning] From: BSM@test.biz "FS_ProdSM_Daily_Full" Time: 14/2/2020 11:32:46 AM
[61:3005] Cannot perform stat() on script "utilns/detach",
system reports: "[3] The system cannot find the path specified. "

[Critical] From: BSM@test.biz "FS_ProdSM_Daily_Full" Time: 14/2/2020 11:32:46 AM
[61:2012] Session pre-exec script utilns/detach -com test script.bat failed. Exit code = 2
The session will not start.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Question about backup

Hello

Start-up and location of the commands
Pre- and post-exec commands for an object are executed before and after the backup of the object, respectively. You can specify these commands for all objects in a backup specification, or for each individual object. When backing up integrations, for example Oracle, the database is considered as an object, so the commands are executed before and after the database backup. These commands are executed on the system where the Disk Agent is running.

On Windows systems Pre- and post-exec scripts for a backup object are started under the Data Protector Inet Service account (by default, the local system account).

The exec scripts for backup objects can reside in any directory on the system where the Disk Agent is running. However, for client backups, they must reside in Data_Protector_homebin. If the scripts are located in the Data_Protector_homebin, specify only the filename, otherwise the full pathname must be specified.

Only .bat, .exe, and .cmd are supported extensions for pre- and post- exec commands. To run a script with unsupported extension (for example, .vbs), create a batch file that starts the script. Then configure Data Protector to run the batch file as a pre- or post-exec command, which then starts the script with the unsupported extension.

If you use quotes () to specify a pathname, do not use the combination of backslash and quotes (). If you need to use a trailing backslash at the end of the pathname, use the double backslash ().

On UNIX systems Pre- and post-exec scripts are started by the backup session owner, unless the backup session owner has Backup as root permission; the commands are then started under root.

The exec commands for backup objects can reside in any directory on the system where the Disk Agent is running. However, for client backups, they must reside in optomnilbin on HP-UX or in usromnibin on other UNIX systems. If the commands are located in the optomnilbin or in usromnibin directory, specify only the filename, otherwise the full pathname must be specified.

As you just want that script will be trigged if backup has finished correctly then we need to use any environment variable.

Environment variables
The following environment variables are set by Data Protector and can be used only in pre- and post- exec scripts for a backup specification on the Cell Manager and not if the command is executed on any other system.

SMEXIT values
VALUE DESCRIPTION
0
All files were successfully backed up.

10
All Agents completed successfully, but not all files were backed up.

11
One or more Agents failed or there was a database error.

12
None of the Agents completed the operation; session was aborted by Data Protector.

13
Session was aborted by a user.

This is an example for to start a consecutive backup after the first backup has successfully finished


#!binsh

# First check how the current backup finished

if [ $SMEXIT != 0 -o $SMEXIT != 10 ]

then

echo Backup not successful -- next backup will not be started!

exit 0

fi

if [ $RESTARTED != 0 ]

then

echo Restarted backup -- next backup will not be started!

exit 0

fi

optomnibinomnib -datalist datalist_name

exit 0

 

Best Regards

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.