#1784 PR closed: Borg backup: update to use different ssh port

Labels: enhancement, won't fix / can't fix / obsolete

patlegu opened issue at 2018-04-24 23:11:

See first pull request. I'm not using pruning from client. All is done on the Borg server, so idealy the 800_prune_old_backups.sh, should be modified too for using this remotely.

Relax-and-Recover (ReaR) Pull Request Template

Please fill in the following items before submitting a new pull request:

Pull Request Details:
  • Type: Bug Fix / New Feature / Enhancement / Other?

  • Impact: Low / Normal / High / Critical / Urgent

  • Reference to related issue (URL):

  • How was this pull request tested?

  • Brief description of the changes in this pull request:
    See first pull request. Same modification.

gozora commented at 2018-04-25 06:49:

Hello @patlegu

  1. For the start, please close #1782, #1783, #1784 and merge your changes to one pull request.
  2. Please honor Relax-and-Recover (ReaR) Pull Request Template

V.

jsmeix commented at 2018-04-25 07:09:

@patlegu see also
https://github.com/rear/rear/pull/1759#issuecomment-374579400
and the subsequent comments therein.

gozora commented at 2018-04-25 07:32:

@patlegu
Just to save a bit of your time, take a look at 100_set_vars.sh.
Just from top of my head, to introduce BORGBACKUP_PORT, it should be enough to modify:

- borg_dst_dev=$BORGBACKUP_USERNAME@$BORGBACKUP_HOST:
+ borg_dst_dev=$BORGBACKUP_USERNAME@$BORGBACKUP_HOST:$BORGBACKUP_PORT:

V.

patlegu commented at 2018-04-25 07:41:

@gozora
I see but it's not enough. When you use a another port with Borgbackup you need to use this syntax:
ssh://$BORGBACKUP_USERNAME@$BORGBACKUP_HOST:$BORGBACKUP_PORT/$BORGBACKUP_REPO
you can't put ":" between your ssh port and the repository.

regards

gozora commented at 2018-04-25 07:50:

In that case:

- borg_dst_dev=$BORGBACKUP_USERNAME@$BORGBACKUP_HOST:
+ borg_dst_dev=ssh://$BORGBACKUP_USERNAME@$BORGBACKUP_HOST:$BORGBACKUP_PORT

Should do the trick, or ?

V.

patlegu commented at 2018-04-25 09:12:

I think something like this in 100_set_vars.sh You only need to use ssh:// if you're using another ssh port.

if [[ -n $BORGBACKUP_HOST ]]; then
    borg_dst_dev=$BORGBACKUP_USERNAME@$BORGBACKUP_HOST:
    # We have to test if anoher port is used.
    if [[ -n $BORGBACKUP_PORT ]]; then
       borg_dst_dev=ssh://$BORGBACKUP_USERNAME@$BORGBACKUP_HOST:$BORGBACKUP_PORT/
    fi
else
    borg_dst_dev=$BUILD_DIR/borg_backup
fi

After taking some files from the master branch, I've made a test and it's working with the above modification. I was wondering why some files on my server were not same as yours. I was on 2.3. 😃

jsmeix commented at 2018-04-26 06:56:

Superseded by https://github.com/rear/rear/pull/1785


[Export of Github issue for rear/rear.]