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:
hooks:
- id: codespell
args:
- '-L=doas,fo'
- '-L=doas,fo,anull'
- repo: https://github.com/Yelp/detect-secrets.git
rev: v1.5.0
......
......@@ -28,7 +28,7 @@ then
usage
elif [ ! -d "$1" ]
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
elif [ "$(id -u)" -ne 0 ]
then
......@@ -70,7 +70,7 @@ for name in $(docker volume ls --filter label=snapshot=true --format '{{ .Name }
do
echo "Backing up $name."
mountpoint="$(docker volume inspect --format '{{ .Mountpoint }}' "$name")"
src="$snapshot/${mountpoint#$root_volume/}"
src="$snapshot/${mountpoint#"$root_volume"/}"
# shellcheck disable=SC2115
[ ! -e "$dest/$name" ] || rm -rf "$dest/$name"
cp --archive --force --reflink=always "$src" "$dest/$name"
......
......@@ -52,7 +52,7 @@ volume="$(root_subvolume /var/backups)"
snapshot="$(mktemp --dry-run "--tmpdir=$volume")"
btrfs subvolume snapshot -r "$volume" "$snapshot"
source="/var/backups"
source="${snapshot}${source#$volume}/"
source="${snapshot}${source#"$volume"}/"
sync --file-system /var/backups
rsync --archive \
......
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