introduced variables for hostname, user and mountpoint

This commit is contained in:
Peter Kannewitz 2023-03-30 10:12:11 +02:00
parent 973b157fc8
commit 8d198cf601

View file

@ -3,9 +3,10 @@
# For example, if you have a constant named "hostname" with the value # For example, if you have a constant named "hostname" with the value
# "myhostname", then the string "{hostname}" will be replaced with # "myhostname", then the string "{hostname}" will be replaced with
# "myhostname" in the configuration file. # "myhostname" in the configuration file.
# constants: constants:
# hostname: myhostname hostname: ag-link.xyz
# prefix: myprefix user: your-username-on-server
mountpoint: /tmp/mnt/ag-link-server
# Where to look for files to backup, and where to store those backups. # Where to look for files to backup, and where to store those backups.
# See https://borgbackup.readthedocs.io/en/stable/quickstart.html and # See https://borgbackup.readthedocs.io/en/stable/quickstart.html and
@ -15,7 +16,7 @@ location:
# List of source directories to backup. Globs and tildes are # List of source directories to backup. Globs and tildes are
# expanded. Do not backslash spaces in path names. # expanded. Do not backslash spaces in path names.
source_directories: source_directories:
- /tmp/mnt/ag-link-server/home/docker - {mountpoint}/home/docker
# Paths to local or remote repositories (required). Tildes are # Paths to local or remote repositories (required). Tildes are
# expanded. Multiple repositories are backed up to in # expanded. Multiple repositories are backed up to in
@ -390,7 +391,7 @@ hooks:
# before creating a backup, run once per repository. # before creating a backup, run once per repository.
before_backup: before_backup:
- mkdir -p /tmp/mnt/ag-link-server - mkdir -p /tmp/mnt/ag-link-server
- sshfs ag-link.xyz:/ /tmp/mnt/ag-link-server -o sftp_server='/usr/bin/sudo /usr/lib/openssh/sftp-server' - sshfs {username}@{hostname}:/ /tmp/mnt/ag-link-server -o sftp_server='/usr/bin/sudo /usr/lib/openssh/sftp-server'
# List of one or more shell commands or scripts to execute # List of one or more shell commands or scripts to execute
# before pruning, run once per repository. # before pruning, run once per repository.
@ -415,7 +416,7 @@ hooks:
# List of one or more shell commands or scripts to execute # List of one or more shell commands or scripts to execute
# after creating a backup, run once per repository. # after creating a backup, run once per repository.
after_backup: after_backup:
- fusermount -u /tmp/mnt/ag-link-server - fusermount -u {mountpoint}
# List of one or more shell commands or scripts to execute # List of one or more shell commands or scripts to execute
# after compaction, run once per repository. # after compaction, run once per repository.