sync.sh: some shellcheck fixes

This commit is contained in:
2022-06-01 17:46:57 +02:00
parent fab41ccc2e
commit 97aea8ddf2
2 changed files with 7 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# #
# sync-conf-example.sh - a "sync.sh" configuration file example. # sync-conf-example.sh - a "sync.sh" configuration file example.
# #
@@ -22,9 +22,9 @@
# SOURCEDIR="" # SOURCEDIR=""
# SERVER="" # SERVER=""
# DESTDIR="" # DESTDIR=""
SOURCEDIR=/example-srcdir export SOURCEDIR=/example-srcdir
SERVER=root@backuphost export SERVER=root@backuphost
DESTDIR=/mnt/nas1/example-destdir export DESTDIR=/mnt/nas1/example-destdir
###### backups to keep ###### backups to keep
# NYEARS=3 # NYEARS=3
@@ -96,7 +96,7 @@ aftersync() {
log -s -t "calling user aftersync" log -s -t "calling user aftersync"
} }
# For Emacs, shell-mode: # For Emacs, shell-script-mode:
# Local Variables: # Local Variables:
# mode: shell-script # mode: shell-script
# End: # End:

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# #
# sync.sh - a backup utility using ssh/rsync facilities. # sync.sh - a backup utility using ssh/rsync facilities.
# #
@@ -480,7 +480,7 @@ parse_opts() {
printf "%s: Cannot open $CONFIG file. Exiting.\n" "$CMDNAME" printf "%s: Cannot open $CONFIG file. Exiting.\n" "$CMDNAME"
exit 9 exit 9
fi fi
# shellcheck source=/dev/null # shellcheck source=sync-conf-example.sh
source "$CONFIG" source "$CONFIG"
LOCKDIR="/tmp/$CMDNAME-$HOSTNAME-${CONFIG##*/}.lock" LOCKDIR="/tmp/$CMDNAME-$HOSTNAME-${CONFIG##*/}.lock"