-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReaR with Borg back end to USB. #1730
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f4d8032
Support for Borg backup to USB device.
gozora 231a9e7
Removed variable BORGBACKUP_USB_DEV, as it proved to be useless.
gozora 6b2cc26
Removed AddExitTask from 250_mount_usb.sh as whole $BUILD_DIR gets re…
gozora 15b5f8a
Do not exit `rear recover' process when `borg extract' fails,
gozora ce82f43
Added and corrected some comments in Borg code.
gozora 6a93a10
Added Borg -> USB documentation example.
gozora File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# This file is part of Relax-and-Recover, licensed under the GNU General | ||
# Public License. Refer to the included COPYING for full text of license. | ||
# | ||
# 250_mount_usb.sh | ||
|
||
# We need to mount USB destination device prior the backup starts | ||
if [[ -z $BORGBACKUP_HOST ]]; then | ||
mount_url usb://$USB_DEVICE $borg_dst_dev | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../prep/BORG/default/900_umount_usb.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This file is part of Relax-and-Recover, licensed under the GNU General | ||
# Public License. Refer to the included COPYING for full text of license. | ||
# | ||
# 250_mount_usb.sh | ||
|
||
# We need to mount USB_DEVICE in order to prepare for Borg archive | ||
# initialization, but only if BORGBACKUP_HOST is not set. | ||
# When BORGBACKUP_HOST is set, we don't need to mount anything as SSH | ||
# backup destination will be handled internally by Borg it self. | ||
if [[ -z $BORGBACKUP_HOST ]]; then | ||
mkdir -p $v "$borg_dst_dev" >&2 | ||
StopIfError "Could not mkdir '$borg_dst_dev'" | ||
|
||
mount_url usb://$USB_DEVICE $borg_dst_dev | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This file is part of Relax-and-Recover, licensed under the GNU General | ||
# Public License. Refer to the included COPYING for full text of license. | ||
# | ||
# 900_umount_usb.sh | ||
|
||
# After BORG operations are over, we can finally umount USB_DEVICE. | ||
# This will force final sync of data that can still sit in cache. | ||
if [[ -z $BORGBACKUP_HOST ]]; then | ||
umount_url usb://$USB_DEVICE $borg_dst_dev | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../prep/BORG/default/250_mount_usb.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,11 @@ StopIfError "Could not change directory to $TARGET_FS_ROOT" | |
# and should not interfere with remaining stages of rear recover. | ||
# This is still not the ideal solution, but best I can think of so far :-/. | ||
LogPrint "Recovering from Borg archive $BORGBACKUP_ARCHIVE" | ||
|
||
LC_ALL=rear.UTF-8 \ | ||
borg extract --sparse $BORGBACKUP_OPT_REMOTE_PATH \ | ||
$BORGBACKUP_USERNAME@$BORGBACKUP_HOST:$BORGBACKUP_REPO::$BORGBACKUP_ARCHIVE | ||
StopIfError "Could not successfully finish Borg restore" | ||
${borg_dst_dev}${BORGBACKUP_REPO}::$BORGBACKUP_ARCHIVE | ||
|
||
LogPrintIfError "Error was reported during Borg restore" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change addresses #1702 |
||
LogPrint "Borg OS restore finished successfully" | ||
popd >/dev/null |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This documentation update (whole IMPORTANT block) addresses part of #1727