** This is a continuation of this article and this article. Please see this article for details. ** **
Thank you very much for your patience. This article will show you how to restore backed up files. (I completely forgot while writing "Please wait because I am currently preparing an article on how to restore ..." Sumimasen)
TL;DR For restoration of individual files, find the backup destination directory and copy and retrieve it directly. The method introduced here is to restore the entire system from the data backed up by the method introduced in the previous article. This time, I think that the number of executions and the environment are different, so I will leave only the command. Please change it according to your environment.
# "/var/backup/Host1/20200101/"Is the backup path(Last/Don't forget)
# "/mnt/host1system/"Is the restore destination path
#When restoring locally
rsync -aHAX --info=progress2 --numeric-ids /var/backup/Host1/20200101/ /mnt/host1system/
#When restoring from a backup server
#backupsv is the host name of the server
rsync -aHAXz --info=progress2 --numeric-ids --rsync-path='sudo rsync' backupsv:/var/backup/Host1/20200101/ /mnt/host1system/
In the previous article, I showed you how to copy the entire system, but restore will use rsync
to copy all the data on the system you want to restore.
What you're doing is actually the opposite of backup.
If you can restore only with a local system such as an external HDD, first start the system to be restored using LiveUSB or the like. After that, create a system partition, mount it, and execute the following command.
# "/var/backup/Host1/20200101/"Is the backup path(Last/Don't forget)
# "/mnt/host1system/"Is the restore destination path
rsync -aHAX --info=progress2 --numeric-ids /var/backup/Host1/20200101/ /mnt/host1system/
Please replace the path etc. as appropriate.
If you back up with a backup server and restore it with a remote server, use ssh as well as backup.
# "/var/backup/Host1/20200101/"Is the backup path(Last/Don't forget)
# "/mnt/host1system/"Is the restore destination path
#backupsv is the host name of the server
rsync -aHAXz --info=progress2 --numeric-ids --rsync-path='sudo rsync' backupsv:/var/backup/Host1/20200101/ /mnt/host1system/
For the above command backupsv ---> host1 (terminal to execute command) It becomes the flow of data. It is an image that pulls data.
This time, it was a restoration that wouldn't happen often, so I've made it a little simpler. We hope this will make it easier for you to recover your system in the event of an emergency. If you have any mistakes, I would appreciate it if you could point them out.
Recommended Posts