#!/bin/bash set -eu -o pipefail function to_volume { echo "-v ${1}:/mnt/source${1}:ro" } HOSTNAME=$(hostname) CONTAINER_NAME="borgmatic" HISTFILE=./data/.bash_history SOURCE_DIR=./data/source CREDENTIALS_DIR=./data/credentials touch ${HISTFILE} # Some of those volumes seem useless, e.g. : # * the repository (which can be mounted within the container) # * mounting the data to save on a precise mount point (one could have several..) podman run \ -h ${HOSTNAME} \ --detach \ --name ${CONTAINER_NAME} \ $(to_volume /home/theenglishway/Documents/cv/) \ $(to_volume /home/theenglishway/Documents/formations/5_jours/) \ -v ./data/borgmatic.d:/etc/borgmatic.d/ \ -v /home/theenglishway/.ssh:/root/.ssh \ -v ${CREDENTIALS_DIR}:/credentials:ro \ -v ${HISTFILE}:/root/.bash_history \ -v borg_config:/root/.config/borg \ -v borg_cache:/root/.cache/borg \ -v borgmatic_state:/root/.local/state/borgmatic \ -v ${SSH_AUTH_SOCK}:${SSH_AUTH_SOCK}:Z \ -e SSH_AUTH_SOCK \ -e TZ=Europe/Paris \ --security-opt=label=disable \ ghcr.io/borgmatic-collective/borgmatic