minor fixes

This commit is contained in:
snaki 2022-07-07 14:48:24 +02:00
parent e883f7b01e
commit 7fb56fab68

18
btrbk
View file

@ -10,7 +10,7 @@ function bkRun {
for i in ${!SUBVOLS[@]}; do for i in ${!SUBVOLS[@]}; do
snapName=${VOLNAME[$i]}.$date snapName=${VOLNAME[$i]}.$date
getSnap "$i" getSnap "$i"
if [[ -d "$SNAPDIR$snapName" && $force = 0 ]] ; then if [[ -d "$SNAPDIR$snapName" ]] && ! $force; then
echo "backup already run today" echo "backup already run today"
continue continue
else else
@ -115,9 +115,9 @@ function testConf {
fi fi
if rclone ls $RCLONEDIR > /dev/null 2>&1; then if rclone ls $RCLONEDIR > /dev/null 2>&1; then
if gpg --list-key $PUBKEY > /dev/null 2>&1; then if gpg --list-key $PUBKEY > /dev/null 2>&1; then
if [ $restore=1 ]; then if $restore; then
runRestore runRestore
elif [ $backup=1 ]; then elif $backup; then
testDate testDate
fi fi
else else
@ -161,19 +161,19 @@ eval set -- "$options"
while true; do while true; do
case $1 in case $1 in
-b|--backup) backup=1; shift;; -b|--backup) backup=true; shift;;
-f|--force) force=1; shift;; -f|--force) force=true; shift;;
-d|--date) rDate="$2"; shift;; -d|--date) rDate="$2"; shift;;
-r|--restore) restore=1; restoreVol=$2; shift;; -r|--restore) restore=true; restoreVol=$2; shift;;
-x|--full-restore) fullRestore=1; restoreDir=$2; shift;; -x|--full-restore) fullRestore=true; restoreDir=$2; shift;;
-h|--help) Help; shift; break;; -h|--help) Help; shift; break;;
--) shift; break;; --) shift; break;;
\?) echo "error"; exit 1;; \?) echo "error"; exit 1;;
esac esac
shift shift
done done
if [ $fullRestore = "1" ]; then if $fullRestore; then
runFullRestore runFullRestore
else elif $backup
testConf testConf
fi fi