#2998 PR merged: Add fully automated restore to REQUESTRESTORE

Labels: enhancement, fixed / solved / done

schlomo opened issue at 2023-05-29 16:23:

Pull Request Details:
  • Type: Enhancement

  • Impact: Low

  • How was this pull request tested?

Manually on Ubuntu 22.04

  • Brief description of the changes in this pull request:

Add an automated restore feature to REQUESTRESTORE, similar to how NFS4SERVER works.

Example:

Confirm the recreated disk layout or go back one step
1) Confirm recreated disk layout and continue 'rear recover'
2) Go back one step to redo disk layout recreation
3) Use Relax-and-Recover shell and return back to here
4) Abort 'rear recover'
(default '1' timeout 300 seconds)

User confirmed recreated disk layout
Now you must manually restore your backup.
Ensure the backup data gets restored into /mnt/local (instead of '/')
because the disks and filesystems of the target system are mounted there.

Waiting for /mnt/local/ok file to signal when the restore is completed and recovery can proceed.
Waiting since 02:05, used storage space: 4.3G
Restored 4.4G in 02:10 minutes.
Created SELinux /mnt/local/.autorelabel file : after reboot SELinux will relabel all files
Recreating directories (with permissions) from /var/lib/rear/recovery/directories_permissions_owner_group

with a config like this:

REQUESTRESTORE_FINISHED_FILE=ok
REQUESTRESTORE_ABORT_FILE=bad

Without those two variables the behaviour is like before, with a prompt and dropping the user into rear_shell.

This will also help with #2988 for this backup method.

I used the following command on another computer to perform the remote restore of a backup created via BACKUP=NETFS

ssh root@192.168.11.52 "tar -C /mnt/local -x -v -z && echo >/mnt/local/ok" </srv/scratch/rear-u2204/backup.tar.gz

@codefritzel what do you think?

@rear/contributors please have a look, I'd like to merge this soon

codefritzel commented at 2023-05-29 17:27:

Waiting since 02:05, used storage space: 4.3G
Restored 4.4G in 02:10 minutes.

The output is a very good idea and also adopted for NFS4SERVER.

schlomo commented at 2023-05-31 21:24:

I fixed everything, please have a look


[Export of Github issue for rear/rear.]