Skip to main content

A package to simplify the borgbackup use with a borg server

Project description

Project borgssh

This package simplifies the borgbackup use with a ssh server on a (remote) computer.

Usage

NAME
    sshborg

SYNOPSIS
    sshborg COMMAND

COMMANDS
    COMMAND is one of the following:

     list
       FIRST of the global commands: borg list ssh://borg@***:2222/config/borg

     create_and_prune_defaults
       SECOND of the global commands, use: sshborg create_and_prune_defaults --configfile ~/.borgssh.conf

     check
       borg check --info ssh://borg@***:2222/config/borg borg info ssh://borg@***:2222/config/borg

     create
       borg create ssh://borg@***:2222/config/borg::host_folder

     extract
       borg extract --dry-run --list ssh://borg@***:2222/config/borg::host_folder_***

Remarks

  • port 2222 is hardcoded
  • username borg is hardcoded
  • prune is hardcoded (7 days, some weeks (8?), every month)

Configuration

The config is in ~/.borgssh.conf by default, but can be in another file and sshborg is run with -c configfile option.

The example of the config:

{
"config": "~/.borgssh.conf",
"remote": "192.168.0.200",
"default_folders": [
 "~/x_Lectures",
 "~/x_DATA_ANALYSIS"
],
"quit": false
}

Server

In general, it is ok to use a prepared docker with ssh server:

docker run -d  --name=openssh-server   --hostname=openssh-server  -e  PUID=1000   -e PGID=1000   -e TZ=Europe/London     -e SUDO_ACCESS=true   -e PASSWORD_ACCESS=true   -e USER_PASSWORD=mysecretpassword   -e USER_NAME=borg   -p 2222:2222   -v /media/raiddisks:/config   --restart unless-stopped   ghcr.io/linuxserver/openssh-server

and install borgbackup inside.

ssh borg@127.0.0.1 -p 2222
sudo borg
apk update && apk add borgbackup --upgrade

then

  • commit the docker with a new name like openssh-server-borg, setup the authorized_keys to restrict ssh
command="/usr/bin/borg serve --restrict-to-path /config/borg" ssh-rsa AAAAB @giga

and the final docker can be run...

docker run -d  --name=openssh-server-borg   --hostname=openssh-server-borg  -e  PUID=1000   -e PGID=1000   -e TZ=Europe/London    -e SUDO_ACCESS=false   -e PASSWORD_ACCESS=false   -e USER_PASSWORD=mysecretpassword   -e USER_NAME=borg   -p 2222:2222   -v /mnt/raiddisks/borgssh:/config   --restart unless-stopped   openssh-server-borg

Borgbackup must be probably init-ed like: borg init ssh://borg@127.0.0.1:2222/config/borg -e none

gitlab:

https://gitlab.com/jaromrax/sshborg

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

borgssh-0.4.21.tar.gz (8.5 kB view details)

Uploaded Source

File details

Details for the file borgssh-0.4.21.tar.gz.

File metadata

  • Download URL: borgssh-0.4.21.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.10

File hashes

Hashes for borgssh-0.4.21.tar.gz
Algorithm Hash digest
SHA256 597ef1c5626f1f62b41aae6eab0e8d63b23b3e7752c3fca596c62327b168359b
MD5 230931e21cb48a3144e25d31f445b9fb
BLAKE2b-256 364456cc59b3485f68697e736eca5b9686b77ee565620e3f676e4da605c4f415

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page