NethServer Version: 7.6.1810
Module: BackupPC from Stephdl wiki page updated to Backup-4.3.0
Hi all,
All is working well but I have some questions about pre/post-restore-[config | data].
- I am restoring from the CLI on the BackuPC host server.
- The tar file excludes: /etc/sysconfig/network-scripts, /boot and /etc/fstab
- I send the key to remote
- I send pre-restore-config and check if it had success.
- I send pre-restore-data and check if it had success.
- I send command to remote to cd to / and to untar:
command used: ssh -p nnnn root@DESTINATION-ip “cd / && /bin/tar -xvv” < source.tar - At the end of the tar file, I receive the message: /bin/tar: Exiting with failure status due to previous errors.
If tar exit with that error, I loose ssh connection with DESTINATION as it now uses the SOURCE ssh key instead of the original DESTINATION ssh key used before the restoration. - On the DESTINATION server console:
- /sbin/e-smith/signal-event post-restore-config
- /sbin/e-smith/signal-event post-restore-data
- /sbin/e-smith/signal-event nethserver-ntp-update
(because without that command, the time is the same as the SOURCE tar file time and DESTINATION server will generate sync command to get to the exact time)
- /usr/sbin/reboot
When the server comes back from the boot, all is exactly like the SOURCE server with the Let’s Encrypt certificate, web sites, etc… All is working correctly.
Before restore:
Do I need to send pre-restore-config and pre-restore-data?
- It looks like pre-restore-config doesn’t do nothing. Also, without having at least one backup-config you cannot use this command.
- No problem at all with pre-restore-data.
After restoration:
Do I need to use post-restore-config --no-reinstall to disable package reinstall during restore?
One shot command
- Is there a way to send all the commands in one shot to DESTINATION from the CLI of the BackupPC?
That way I won’t have to use the DESTINATION server console which sometime might be unavailable if in a remote site.
Something like this:
ssh -p nnnn root@DESTINATION-IP \
"cd / && /bin/tar -xvv; \
/sbin/e-smith/signal-event post-restore-config; \
/sbin/e-smith/signal-event post-restore-data;\
/sbin/e-smith/signal-event nethserver-ntp-update; \
/usr/sbin/reboot; \
" < source.tar
For that one shot command, I will have to solve the tar error message…
All suggestions appreciated,
Michel-André