#1800 Issue closed: Support Question: Pipe output

Labels: support / question, fixed / solved / done

namezero111111 opened issue at 2018-05-08 12:13:

Dear folks,

we want to evaluate REAR, and want to backup a restoreable USB image to Bareos, so we can just recover that to another machine, and recover from there.

Is there a way to pipe the output of REAR into another process?

Thanks!

gdha commented at 2018-05-08 12:20:

@namezero111111 Why not using BACKUP=BAREOS directly? See example https://gist.github.com/gdha/178504db0f6e0099848c2963ece81b6a#file-rear-automated-test-sh-log-L203

namezero111111 commented at 2018-05-08 12:24:

Does doing so backup the recovery image to bareos, too?
We would also like to be able to restore without network connectivity so we can restore to test environments.


Od: gdha notifications@github.com
Wysłano: wtorek, 8 maja 2018 14:20
Do: rear/rear
DW: Andreas M. Iwanowski; Mention
Temat: Re: [rear/rear] Support Question: Pipe output (#1800)

@namezero111111https://github.com/namezero111111 Why not usingBACKUP=BAREOS directly? See example https://gist.github.com/gdha/178504db0f6e0099848c2963ece81b6a#file-rear-automated-test-sh-log-L203


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/rear/rear/issues/1800#issuecomment-387383691, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AA9kBql4131lld1u7nHDHwSk5YphnLgTks5twY2NgaJpZM4T2iB8.

gozora commented at 2018-05-08 12:44:

@namezero111111

Isn't it easier to do whole backup (ReaR recovery system + OS data) to USB ?

V.

namezero111111 commented at 2018-05-08 14:39:

Mhh... ok. Maybe this was phrased in an unfortunate way.
We are trying to use Rear to have a full BMR of some CentOS6/7 machines. This backup should be completely in Bareos, including the (custom?) boot image for each machine.
As an additional benefit, we would like to be able, if the necessity arises, to be able to restore random machines in isolated environments where they will not have access to the original Bareos server druing restore.

For many machines, we backup the images directly from VMware to achieve these goals. However, in some cases this option is not available for a varietly of reasons, so we are looking into an alternative in these cases.

jsmeix commented at 2018-05-09 08:59:

My untested first idea is to not change ReaR
but to use ReaR as it is meant to be used
and do the intended things "outside" of ReaR
something like the following

Configure ReaR so that "rear mkrescue" stores
the results on the local disk.

Configure the backup so that the "rear mkrescue"
results are also included in the backup.

Run the backup directly if an external backup tool is used
or run "rear mkbackuponly" if an internal backup tool is used
to get a backup that also contains the "rear mkrescue" results.

Background information:

There is no feasible way (with reasonable effort)
to pipe the output of ReaR into another process
because ReaR does not write its output as a single
stream of dats to a single file descriptor that could be
redirected into a pipe.

Note that stdout and stdin are redirected into the ReaR log file,
cf. "What to do with stdin, stdout, and stderr" at
https://github.com/rear/rear/wiki/Coding-Style

"rear mkrescue" produces various regular files,
the so called RESULT_FILES (see default.conf).

ReaR supports to send the RESULT_FILES via
mail (see default.conf).

ReaR does not support to output the RESULT_FILES
as a data stream via a file descriptor that could be
redirected into a pipe.

"rear mkbackup" produces the RESULT_FILES
plus whatever specific kind of backup (files)
that depend on the particular backup program
that is called by ReaR and how support for that
particular backup program is implemented in ReaR,
cf. "Relax-and-Recover versus backup and restore" in
https://en.opensuse.org/SDB:Disaster_Recovery

jsmeix commented at 2018-05-09 09:01:

@namezero111111
in general regarding questions about third-party backup tools (like Bareos)
you should better directly ask those who make the third-party backup tool.
In particular I do not use any third-party backup tool so that
I cannot answer any question about third-party backup tools.

didacog commented at 2018-05-09 09:53:

@namezero111111

You can combine ReaR, DRLM and BareOS.
DRLM provides DR over network (PXE) and manages ReaR installations. You can export/import DRLM images (rear backup + boot img PXE) from/to different servers(clients) for testing, migrations or installations from template DR image, then You can get those backups with BareOS from /var/lib/drlm/arch in DRLM server with a standard BareOS backup job on a convenient backup window.
DRLM keeps a configurable number of DR images at disk, olders are removed, you can always restore any older DR image from BareOS to any DRLM server, import it to a DRLM client and recover it.

Hope this can help you.

Regards,
Didac

namezero111111 commented at 2018-05-10 06:13:

Ok thank you for all your expert advice. We will try the suggestions in a test environment and report back!


[Export of Github issue for rear/rear.]