rearange borgmatic setup and configuration
This commit is contained in:
@@ -1,38 +1,52 @@
|
||||
location:
|
||||
source_directories:
|
||||
- /remote/server/bram
|
||||
repositories:
|
||||
- /repo/bram
|
||||
source_directories:
|
||||
- /remote/server/bram
|
||||
|
||||
storage:
|
||||
encryption_passcommand: cat /keys/bram.key
|
||||
compression: lz4
|
||||
archive_name_format: '{now:%Y-%m-%d}'
|
||||
repositories:
|
||||
- path: /repo/bram
|
||||
|
||||
retention:
|
||||
keep_daily: 7
|
||||
keep_weekly: 4
|
||||
keep_monthly: 6
|
||||
prefix: '20'
|
||||
encryption_passcommand: cat /keys/bram.key
|
||||
|
||||
consistency:
|
||||
checks:
|
||||
- repository
|
||||
- archives
|
||||
check_last: 3
|
||||
prefix: '20'
|
||||
umask: 22
|
||||
|
||||
hooks:
|
||||
before_backup:
|
||||
- echo -e "\n\n"
|
||||
- echo "#"
|
||||
- echo "# `date` - Starting a backup job."
|
||||
- echo "#"
|
||||
after_backup:
|
||||
- echo "#"
|
||||
- echo "# `date` - Backup created."
|
||||
- echo "#"
|
||||
on_error:
|
||||
- echo "#"
|
||||
- echo "# `date` - Error while creating a backup."
|
||||
- echo "#"
|
||||
compression: lz4
|
||||
archive_name_format: '{now:%Y-%m-%d}'
|
||||
unknown_unencrypted_repo_access_is_ok: true
|
||||
|
||||
keep_daily: 7
|
||||
keep_weekly: 4
|
||||
keep_monthly: 6
|
||||
|
||||
checks:
|
||||
- name: repository
|
||||
- name: archives
|
||||
check_last: 3
|
||||
|
||||
commands:
|
||||
- before: action
|
||||
when:
|
||||
- create
|
||||
run:
|
||||
- |
|
||||
set -euo pipefail
|
||||
REMOTE=/remote/server/bram
|
||||
echo "Mounting $REMOTE..."
|
||||
mkdir -p "$REMOTE"
|
||||
sshfs user@bram.veenboer.xyz:/media/helios/Bram "$REMOTE"
|
||||
|
||||
- after: action
|
||||
when:
|
||||
- create
|
||||
run:
|
||||
- |
|
||||
set -eu
|
||||
REMOTE=/remote/server/bram
|
||||
echo "Unmounting $REMOTE..."
|
||||
if mountpoint -q "$REMOTE"; then
|
||||
if command -v fusermount >/dev/null 2>&1; then
|
||||
fusermount -u "$REMOTE"
|
||||
else
|
||||
umount "$REMOTE"
|
||||
fi
|
||||
else
|
||||
echo "$REMOTE is not a mountpoint, nothing to unmount."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user