From: Sugar Labs BOFH Date: Sun, 17 May 2015 05:11:30 +0000 (-0400) Subject: Small indentation changes. X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=7525deb315bef85b8616bb3babf1e737d509455e;p=wizbackup.git Small indentation changes. --- diff --git a/wizbackup b/wizbackup index 975fc6a..d96ee40 100755 --- a/wizbackup +++ b/wizbackup @@ -61,14 +61,12 @@ else fi # Error tolerant grep -tgrep() -{ +tgrep() { grep "$@" return 0 } -do_backup() -{ +do_backup() { set -o pipefail echo "$(date): rsync $RSYNC_OPTS $SRC $DEST/tmp/" rsync $RSYNC_OPTS "$SRC" "$DEST/tmp/" 2>&1 | tgrep -v -E 'vanished|some files' @@ -91,9 +89,7 @@ do_backup() set +o pipefail } - -do_init() -{ +do_init() { # Safety net (4 slashes just in case) case "$DEST" in /|//|///|////) exit 666 ;; @@ -107,8 +103,7 @@ do_init() cd "$DEST" || exit 668 } -do_prune() -{ +do_prune() { local old="`ls | grep -v tmp | head -n -$SNAPSHOTS`" if [ ! -z "$old" ]; then echo "$(date): Removing oldest snapshot(s): $old..." @@ -116,8 +111,7 @@ do_prune() fi } -do_link() -{ +do_link() { local newest=`ls | grep -v tmp | tail -n 1` if [ -d "$DEST/tmp" ]; then echo "$(date): Continuing with pre-existing snapshot $DEST/tmp" @@ -137,8 +131,7 @@ do_link() fi } -do_test() -{ +do_test() { # TODO: test for free space and free inodes in the $DEST filesystem block_size=`stat --file-system --format "%S" "$DEST"` free_blocks=`stat --file-system --format "%f" "$DEST"`