summaryrefslogtreecommitdiff
path: root/bak
diff options
context:
space:
mode:
authorTslil Clingman <tslil.clingman@gmail.com>2017-05-28 17:32:03 -0500
committerTslil Clingman <tslil.clingman@gmail.com>2017-05-28 17:32:03 -0500
commit721668ea57fda4254ceee9146c6b6bee470b3fc6 (patch)
treef0f7a8078c601d47dd521567749b215f9ca36373 /bak
parent6d1077a28b8d6f64ca72b9aa00f0b2cab97fb594 (diff)
Ran shellcheck, fixed (?) things
Diffstat (limited to 'bak')
-rwxr-xr-xbak14
1 files changed, 7 insertions, 7 deletions
diff --git a/bak b/bak
index 5765934..0522491 100755
--- a/bak
+++ b/bak
@@ -18,16 +18,16 @@ for k in $*; do
path=$(echo ${strip%/*} | sed "s#$HOME##")
stamp="$(date +%y%m%d-%H%M%S)"
name="$(echo $bakdir/$path/$folder-$stamp.tar.xz | sed 's#//#/#g')"
- echo Archiving and compressing $name ...
- mkdir -p $bakdir/$path
- cd $k; cd ..
+ echo Archiving and compressing "$name" ...
+ mkdir -p "$bakdir"/"$path"
+ cd "$k" || return 127 ; cd ..
if [ -n "$e" ]; then
- echo Encrypting $name
- tar --xz --atime-preserve -p -cO $folder | gpg $e - > $name.gpg
+ echo Encrypting "$name"
+ tar --xz --atime-preserve -p -cO "$folder" | gpg "$e" - > "$name".gpg
else
- tar --xz --atime-preserve -p -cf $name $folder
+ tar --xz --atime-preserve -p -cf "$name" "$folder"
fi;
else
- echo Skipping $k, not a directory
+ echo Skipping "$k", not a directory
fi
done