Skip to content
Snippets Groups Projects
Verified Commit 580f91f9 authored by Jelle van der Waa's avatar Jelle van der Waa :construction:
Browse files

Exclude btrfs docker submount from being backed up

The backup script fails on our Gitlab machine as it tries to remove a
snapshot of the docker submount, which we do not want to backup anyway.

btrfs subvolume snapshot -r /var/lib/docker/btrfs /var/lib/docker/btrfs/backup-snapshot
ERROR: Not a Btrfs subvolume: Invalid argument
parent afd86b6d
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,8 @@ delete_snapshot() {
}
if is_btrfs "$src"; then
list_of_btrfs_submounts=$(findmnt -Rl -o target,fstype,options / | grep btrfs | grep -v "subvol=\/[[:alnum:]]" | cut -d ' ' -f1)
# List all btrfs submounts we want to backup, e.g. homedir.archlinux.org with "/ /home"
list_of_btrfs_submounts=$(findmnt -Rl -o target,fstype,options / | grep btrfs | grep -v docker | grep -v "subvol=\/[[:alnum:]]" | cut -d ' ' -f1)
if [[ -d "$backup_mountdir" ]]; then
if [[ $(findmnt -M "$backup_mountdir") ]]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment