Skip to content
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

Borg backup: Update for using diffrent ssh port #1782

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions usr/share/rear/prep/BORG/default/300_init_archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,19 @@ rc=$?
# `borg init` has to be triggered in "prep" stage if user decides to include
# keyfiles to Relax-and-Recover rescue/recovery system using COPY_AS_IS_BORG.
if [ $rc -ne 0 ]; then
LogPrint "Failed to list $BORGBACKUP_REPO"
LogPrint "Creating new Borg repository $BORGBACKUP_REPO"

borg init $BORGBACKUP_OPT_ENCRYPTION $BORGBACKUP_OPT_REMOTE_PATH \
$BORGBACKUP_OPT_UMASK ${borg_dst_dev}${BORGBACKUP_REPO}
rc=$?
if [ ! -z $BORGBACKUP_PORT ]; then
LogPrint "Failed to list $BORGBACKUP_REPO on $BORGBACKUP_HOST:$BORGBACKUP_PORT"
LogPrint "Creating new Borg repository $BORGBACKUP_REPO on $BORGBACKUP_HOST:$BORGBACKUP_PORT"
borg init $BORGBACKUP_OPT_ENCRYPTION $BORGBACKUP_OPT_REMOTE_PATH \
ssh://$BORGBACKUP_USERNAME@$BORGBACKUP_HOST:$BORGBACKUP_PORT/$BORGBACKUP_REPO
rc=$?
else
LogPrint "Failed to list $BORGBACKUP_REPO on $BORGBACKUP_HOST"
LogPrint "Creating new Borg repository $BORGBACKUP_REPO on $BORGBACKUP_HOST"
borg init $BORGBACKUP_OPT_ENCRYPTION $BORGBACKUP_OPT_REMOTE_PATH \
$BORGBACKUP_USERNAME@$BORGBACKUP_HOST:$BORGBACKUP_REPO
rc=$?
fi
fi

# Borg repository initialization failed in previous step,
Expand Down