#3523 Issue open: EXTERNAL_RESTORE does not run¶
Labels: bug, support / question
towfiqi opened issue at 2025-09-24 08:01:¶
ReaR version¶
Relax-and-Recover 2.9 / 2025-02-13
Describe the ReaR bug in detail¶
I am using external backup and restore commands in my config to create a
rescue ISO and recover it later. The backup process works fine, and the
required programs are being copied over. But when I try to recover on a
test machine with rear recover, and I confirm all the disk layout
creation prompts with 1, it finally exits with
Now you must manually restore your backup.
My expectation was that, after the disk layout creation, the command specified in the EXTERNAL_RESTORE would run automatically. In fact, a few days ago, when I generated an ISO with rear v2.3, with a similar config, it automatically restored the files by running the EXTERNAL_BACKUP command. However, I now have to run the restore command manually.
This is how my rear config file looks:
# Rear configuration
OUTPUT=ISO
OUTPUT_URL=file:///home/data/rescue
OUTPUT_PREFIX=""
ISO_PREFIX="rear"
BACKUP=EXTERNAL
# Defines the external commands for backup
EXTERNAL_BACKUP="prestic backup / /boot -r rclone:PCloud:server-backup/rescue-data --one-file-system --exclude '/tmp/*' --exclude '/var/tmp/*' --exclude '/var/cache/*'"
# copy rclone and restic binaries and rclone config for the prestic and prclone shell scripts
COPY_AS_IS+=( '/home/binaries/linux-x64/rclone' )
COPY_AS_IS+=( '/home/binaries/linux-x64/restic' )
COPY_AS_IS+=( '/home/config/rclone.conf' )
REQUIRED_PROGS+=( 'prestic' )
REQUIRED_PROGS+=( 'prclone' )
# Defines the external commands for restoration
EXTERNAL_RESTORE="prestic -r rclone:PCloud:server-backup/rescue-data restore latest --target /mnt/local"
This is what the recovery log prints out for the restore stage
(rear recover -d):
2025-09-24 07:35:57.472581548 Running 'restore' stage
2025-09-24 07:35:57.476599310 = nming 'restore' stage
2025-09-24 07:35:57.493553853 Including restore/default/050_remount_async.sh
2025-09-24 07:35:57.501210538 Including restore/REQUESTRESTORE/default/200_prompt_user_to_start_restore.sh
2025-09-24 07:35:57.504949041 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.
Platform¶
No response
OS version¶
Debian 12
Backup¶
EXTERNAL
Storage layout¶
No response
What steps will reproduce the bug?¶
No response
Workaround, if any¶
No response
Additional information¶
No response
gdha commented at 2025-09-27 09:08:¶
@towfiqi Interesting topic, however, never used EXTERNAL_BACKUP myself.
Restic - wouldn't it be better to work on a BACKUP=RESTIC workflow? It
seems you know what is needed and how to use it from backup to restore.
Have a look at similar BACKUP mechanism inside rear. See
https://github.com/rear/rear/blob/master/doc/user-guide/10-integrating-external-backup.md
for a more in-depth explanation.
IMHO it would be a good thing to have for the ReaR community - thanks.
towfiqi commented at 2025-09-27 13:19:¶
@gdha Rear doesn't have a built-in workflow for Restic, so a custom one using BACKUP=RESTIC would require writing a Linux and Bash script. Since I don't have that expertise, I'm opting for the simpler, pre-existing BACKUP=EXTERNAL workflow instead.
gdha commented at 2025-11-13 16:36:¶
@towfiqi Try out once the variable
RECOVERY_COMMANDS=( "prestic -r rclone:PCloud:server-backup/rescue-data restore latest --target /mnt/local" )
instead of the
EXTERNAL_RESTORE="prestic -r rclone:PCloud:server-backup/rescue-data restore latest --target /mnt/local"
towfiqi commented at 2025-11-14 15:33:¶
Thanks for your reply.
Just tried that. After ReaR completes the disk layout process, it prints out this message:
Please start the restore process on your backup host.
Make sure that you restore the data into /mnt/local (by default '/mnt/local') instead of '/' because the hard disks of the recovered system are mounted there.
Please restore your backup in the provided shell and, when finished, type exit in the shell to continue recovery.
So it's not automatically running the restore command set in the
RECOVERY_COMMANDS
gdha commented at 2025-11-14 15:40:¶
@towfiqi Indeed, you are right!
The RECOVERY_COMMANDS array specifies the "rear recover" commands
that are automatically called after the ReaR recovery system has started
up
to recreate the system in 'auto_recover'/'automatic' or 'unattended'
mode.
I should read the manuals myself more ;-(
To get this going you need to add ADD_KERNEL_ARG="unattended" to the
local.conf file.
towfiqi commented at 2025-11-15 02:54:¶
Just tried that. Same issue. I am using a custom conf file to create the
rear backup/ISO using the -c flag. Once I boot with the ISO, is there
a way to check if the changes in the conf file I made took effect? I
navigate to etc/rear in the ISO booted machine while in the rear
recovery session, but I don't see any conf file that has all the
settings for the recovery process. There's only a default.conf and
rescue.conf file. I am pretty sure it worked, as the programs that I
defined to copy from the host machine to the ISO in the conf file is
accessible in the ISO. But I want to make sure that our ADD_KERNAL_ARG
change indeed took place.
And is using the -c for the rear backup command have something to do
with this, as per #2942
gdha commented at 2025-11-15 08:57:¶
@towfiqi I performed a successful recovery with restic - the
/etc/rear/local.conf looks like:
BACKUP=EXTERNAL
OUTPUT=ISO
OUTPUT_URL=nfs://192.168.122.1/apps/export/RBME
COPY_AS_IS+=( '/etc/restic_exclude_files' '/etc/restic-password' '/root/.ssh/id_rsa' )
SSH_FILES="yes"
REQUIRED_PROGS+=( 'restic' )
EXTERNAL_BACKUP="restic -r sftp:root@192.168.122.1:/apps/export/RBME/restic-backup backup / /boot --one-file-system --exclude-file /etc/restic_exclude_files --password-file /etc/restic-password"
EXTERNAL_RESTORE="restic -r sftp:root@192.168.122.1:/apps/export/RBME/restic-backup restore latest --target /mnt/local --password-file /etc/restic-password"
And, a small excerpt from the log file:
2025-11-15 09:28:25.270713199 Including restore/EXTERNAL/default/500_restore_with_external.sh
2025-11-15 09:28:25.273112093 Running external restore command
2025-11-15 09:28:25.278702320 Running 'restic -r sftp:root@192.168.122.1:/apps/export/RBME/restic-backup restore latest --target /mnt/local --password-file /etc/restic-password'
subprocess ssh: Authorized uses only. All activity may be monitored and reported.
restoring <Snapshot bc5104c1 of [/ /boot] at 2025-11-15 09:24:09.583682893 +0100 CET by root@alma> to /mnt/local
2025-11-15 09:29:52.188733285 Finished external restore command
[Export of Github issue for rear/rear.]