Skip to content
Snippets Groups Projects
Commit dce2a28b authored by nimrod's avatar nimrod
Browse files

pre-commit: Address some warnings.

parent 4a789af0
No related branches found
No related tags found
No related merge requests found
Pipeline #4230 passed
...@@ -24,7 +24,7 @@ repos: ...@@ -24,7 +24,7 @@ repos:
hooks: hooks:
- id: codespell - id: codespell
args: args:
- '-L=doas,fo' - '-L=doas,fo,anull'
- repo: https://github.com/Yelp/detect-secrets.git - repo: https://github.com/Yelp/detect-secrets.git
rev: v1.5.0 rev: v1.5.0
......
...@@ -28,7 +28,7 @@ then ...@@ -28,7 +28,7 @@ then
usage usage
elif [ ! -d "$1" ] elif [ ! -d "$1" ]
then then
echo "Destinaton $1 not found or is not a directory." >&2 echo "Destination $1 not found or is not a directory." >&2
exit 1 exit 1
elif [ "$(id -u)" -ne 0 ] elif [ "$(id -u)" -ne 0 ]
then then
...@@ -70,7 +70,7 @@ for name in $(docker volume ls --filter label=snapshot=true --format '{{ .Name } ...@@ -70,7 +70,7 @@ for name in $(docker volume ls --filter label=snapshot=true --format '{{ .Name }
do do
echo "Backing up $name." echo "Backing up $name."
mountpoint="$(docker volume inspect --format '{{ .Mountpoint }}' "$name")" mountpoint="$(docker volume inspect --format '{{ .Mountpoint }}' "$name")"
src="$snapshot/${mountpoint#$root_volume/}" src="$snapshot/${mountpoint#"$root_volume"/}"
# shellcheck disable=SC2115 # shellcheck disable=SC2115
[ ! -e "$dest/$name" ] || rm -rf "$dest/$name" [ ! -e "$dest/$name" ] || rm -rf "$dest/$name"
cp --archive --force --reflink=always "$src" "$dest/$name" cp --archive --force --reflink=always "$src" "$dest/$name"
......
...@@ -52,7 +52,7 @@ volume="$(root_subvolume /var/backups)" ...@@ -52,7 +52,7 @@ volume="$(root_subvolume /var/backups)"
snapshot="$(mktemp --dry-run "--tmpdir=$volume")" snapshot="$(mktemp --dry-run "--tmpdir=$volume")"
btrfs subvolume snapshot -r "$volume" "$snapshot" btrfs subvolume snapshot -r "$volume" "$snapshot"
source="/var/backups" source="/var/backups"
source="${snapshot}${source#$volume}/" source="${snapshot}${source#"$volume"}/"
sync --file-system /var/backups sync --file-system /var/backups
rsync --archive \ rsync --archive \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment