#2242 Issue closed: Integration REAR and NetBackup. Script "400_restore_with_nbu.sh". How to create a new variable "sdate"

Labels: support / question, fixed / solved / done, external tool

cge77 opened issue at 2019-09-27 18:28:

Hi all.

I am with the integration of REAR with NetBackup. I have all fine more or less but I have a problem I cannot solve because my develop knowledge is limited :)

The issue is if I do a point in time restore, the date and time I type is configured in the script "400_restore_with_nbu.sh" in the command "bprestore" as the variable "edate", that is perfect but when you launch the recover, NetBackup restores all the full backups of the server from the date and time you specified and also to the past... This does obviously the backup is not consistent. You can specify a time interval in the "bprestore" command using the parameters "-s" (start) and the previously mentioned "-e" (end). What I intend is to create a new variable "sdate" for example with the date and time of the variable "edate" -1 second. I have tested this manually in the command "bprestore" and works fine. Curiously, you have to put these parameters in the next order to works fine: "bprestore -e -s", if you do not follow this order, the command fails. With the parameters "-e" and "-s", you can restore the exactly backup you want :D

My question is, how I can create a new variable "sdate" getting the information (date and time) of the variable "edate" and subtracting 1 second? I am checking the proper script "400_restore_with_nbu.sh" and the script "390_request_point_in_time_restore_parameters.sh" (the script that treat when REAR ask about the date and time of the restore). But here are inputs outputs topics and others and I am lost here...

As we commented above, my develop knowledge is limited and I am not be able to solve this problem... Solve it it would be nice because we would get REAR and NetBackup able to restore the exact backup :)

Thank you very much!

P.D: a good idea could be using the same date and time in the "-e" and "-s" parameters and, if this works, we have not do nothing but I tested and NetBackup give an error 127 that means NetBackup does not find the backup required.

P.D.2: I can share what I do to integrate REAR and NetBackup if it can be useful for the community :)

jsmeix commented at 2019-10-01 14:21:

in general please provide the generic information we request in
in particular your /etc/rear/local.conf file and ReaR debug log files
for rear -D mkbackup and rear -D recover could help us
to better see what exactly is going on in your particular case,
cf. "Debugging issues with Relax-and-Recover" in

In general regarding enhanchements for ReaR bash scripts
we would need to get your complete and excat current code
so that we can have a look what exactly the code changes are about
(regardless whether or not your current code changes do actually work).

In particular regarding BACKUP=NBU:
In general there is nothing at all what I could do in case of issues
with third-party backup tools or any other third-party software
because I do not have such software on my test systems
so that I can neither test nor reproduce anything.
But I can help with generic bash scripting issues.

The latest changes related to NBU_* config variables in default conf
point to the GitHub commits
that point to the GitHub pull requests and issues
where @rmetrich was working on it
where @ofalk was working on it.

@rmetrich @ofalk
could you please have a look here?

as in
I dared to also assign this issue to you.

ofalk commented at 2019-10-01 14:48:

I'd love to help our here, but I do not have this running in my env, only in some customer environment. Sorry.

cge77 commented at 2019-10-04 14:02:

Hi all.

Thanks for the information and for the help.

I solved the issue using the parameter "-T" (True Image Restore) in the "bprestore" command in the script "400_restore_with_nbu.sh".

Many thanks!

jsmeix commented at 2019-10-05 12:51:

thank you for your prompt reply!

thank you for your feedback how you got it working for you.

[Export of Github issue for rear/rear.]