start.sh 837 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. set -eu -o pipefail
  3. HOSTNAME=$(hostname)
  4. CONTAINER_NAME="borgmatic"
  5. HISTFILE=./data/.bash_history
  6. SOURCE_DIR=./data/source
  7. touch ${HISTFILE}
  8. sudo mount --bind /home/ ${SOURCE_DIR}/home
  9. # Some of those volumes seem useless, e.g. :
  10. # * the repository (which can be mounted within the container)
  11. # * mounting the data to save on a precise mount point (one could have several..)
  12. podman run \
  13. -h ${HOSTNAME} \
  14. --replace \
  15. --detach \
  16. --name ${CONTAINER_NAME} \
  17. -v ${SOURCE_DIR}:/mnt/source:ro \
  18. -v ./data/borgmatic.d:/etc/borgmatic.d/ \
  19. -v /home/theenglishway/.ssh:/root/.ssh \
  20. -v ${HISTFILE}:/root/.bash_history \
  21. -v borg_config:/root/.config/borg \
  22. -v borg_cache:/root/.cache/borg \
  23. -v borgmatic_state:/root/.local/state/borgmatic \
  24. -e TZ=Europe/Paris \
  25. ghcr.io/borgmatic-collective/borgmatic