feat(borg-runner): Support different ssh port
Add support for different remote ssh port
This commit is contained in:
parent
411cb2be6a
commit
1df17edee9
2 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue