From 1df17edee91d85a4b3d7629fbff2fa9d319c4802 Mon Sep 17 00:00:00 2001 From: nikurasu Date: Sat, 27 Jan 2024 19:57:31 +0100 Subject: [PATCH] feat(borg-runner): Support different ssh port Add support for different remote ssh port --- borgbackup_alpine_runner/Dockerfile | 2 +- borgbackup_alpine_runner/run_borg.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/borgbackup_alpine_runner/Dockerfile b/borgbackup_alpine_runner/Dockerfile index e37e0fa..6eaff8f 100644 --- a/borgbackup_alpine_runner/Dockerfile +++ b/borgbackup_alpine_runner/Dockerfile @@ -2,4 +2,4 @@ FROM alpine:3.19 RUN apk --no-cache add openssh borgbackup bash tzdata COPY ./run_borg.sh /run_borg.sh VOLUME [ "/backup", "/ssh_privKey" ] -CMD /run_borg.sh -d $BKP_DIR -u $USER -s $SERVER -r $REPOSITORY -n $BACKUPNAME +CMD /run_borg.sh -d $BKP_DIR -u $USER -s $SERVER -p $SSH_PORT -r $REPOSITORY -n $BACKUPNAME diff --git a/borgbackup_alpine_runner/run_borg.sh b/borgbackup_alpine_runner/run_borg.sh index afb4a78..ddcf16e 100755 --- a/borgbackup_alpine_runner/run_borg.sh +++ b/borgbackup_alpine_runner/run_borg.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -while getopts d:u:s:r:n: flag +while getopts d:u:s:r:n:p: flag do case "${flag}" in d) bkp_dir=${OPTARG};; @@ -7,8 +7,10 @@ do s) server=${OPTARG};; r) repository=${OPTARG};; n) backupname=${OPTARG};; + p) port=${OPTARG};; esac done +BORG_RSH='ssh -p ${port}' echo "Copy ssh priv key" mkdir $HOME/.ssh mkdir /logs