#751 Issue closed: Question: Update system backup source during rescue image's bootup?

Labels: support / question

yin747 opened issue at 2016-01-05 13:49:

Is it possible to change the system recovery source to new one (ie: file///share --> nfs://xxx/yy, when we boot the rescue image.

gdha commented at 2016-01-05 13:57:

The answer was already mentioned in issue #750 - before running rear recover edit the local.conf file and change the BACKUP_URL variable.

schlomo commented at 2016-01-05 14:00:

Or, as mentioned in #750, use Bash code in local.conf to decide the content of BACKUP_URL while ReaR runs. E.g. something like this:

if [[ "$WORKFLOW" == "recover" ]] ; then
    BACKUP_URL=nfs://server/path
else
   BACKUP_URL=file:///local/dir
fi

0xkakuki commented at 2016-01-06 14:19:

To make the ISO image generated for local restore also usable in NFS recover condition, you need to add the 'mount.nfs' 'umount.nfs' to PROGS variable. Then boot the restore system with "Recover " menuentry and proceed the restore manually. For example:

BACKUP_URL=file:///mnt/
PROGS=("${PROGS[@]}" 'mount.nfs' 'umount.nfs')

As these two files will not be included in the boot image under the 'file' schema.

I'm also trying Schlomo's method hoping that it can automate the whole procedure.

Regards,
Kakuki

0xkakuki commented at 2016-01-06 14:42:

Hi,

With Schlomo's suggestion, it works like a charm. Here are my rear settings:

# cat /etc/rear/local.conf | grep -v ^#

OUTPUT=ISO
BACKUP=NETFS

PROGS=("${PROGS[@]}" 'mount.nfs' 'umount.nfs')
if [[ "$WORKFLOW" == "recover" ]] ; then
    BACKUP_URL=nfs://192.168.56.1/storage
else
    BACKUP_URL=file:///mnt/
fi

SSH_ROOT_PASSWORD="hello123"
BACKUP_PROG_EXCLUDE=("${BACKUP_PROG_EXCLUDE[@]}" '/media' '/var/tmp' '/var/crash')
NETFS_KEEP_OLD_BACKUP_COPY=no

Thanks,
Kakuki


[Export of Github issue for rear/rear.]