Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
infrastructure
Commits
245c99fb
Verified
Commit
245c99fb
authored
Jan 05, 2020
by
Sven-Hendrik Haase
Browse files
roles/borg-client: Fix backup script behavior for non-btrfs systems
parent
053341eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
roles/borg-client/templates/borg-backup.sh.j2
View file @
245c99fb
...
...
@@ -38,6 +38,8 @@ if is_btrfs "$src"; then
btrfs subvolume snapshot
-r
"
$vol
"
"
$vol
/
$snapshotdir
"
mount
-o
bind
"
$vol
/
$snapshotdir
"
"
$backup_mountdir
/
$vol
"
done
else
backup_mountdir
=
"
$src
"
fi
systemctl is-active postgresql
&&
/usr/local/bin/backup-postgres.sh
||
true
...
...
@@ -61,10 +63,12 @@ borg create -v --stats -C lz4 \
{{
backup_host
}}
:
{{
backup_dir
}}
::
$(
date
"+%Y%m%d-%H%M%S"
)
"
$backup_mountdir
"
borg prune
-v
{{
backup_host
}}
:
{{
backup_dir
}}
--keep-daily
=
7
--keep-weekly
=
4
--keep-monthly
=
6
umount
-R
"
$backup_mountdir
"
for
vol
in
$list_of_btrfs_submounts
;
do
delete_snapshot
"
$vol
/
$snapshotdir
"
done
rmdir
"
$backup_mountdir
"
if
is_btrfs
"
$src
"
;
then
umount
-R
"
$backup_mountdir
"
for
vol
in
$list_of_btrfs_submounts
;
do
delete_snapshot
"
$vol
/
$snapshotdir
"
done
rmdir
"
$backup_mountdir
"
fi
/usr/bin/vendor_perl/borg-restore.pl
--update-cache
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment