# Please read the file COPYING, README and AUTHORS for more information.
#
-NAME=`basename $0`
+NAME=$(basename "$0")
PIDFILE="/var/run/$NAME.pid"
DRYRUN=0
for f in $sys; do
[ -r "$f" -a -f "$f" ] || continue
- fname=`basename $f`
+ fname=$(basename "$f")
case "$fname" in
"backup-script.conf"|*.sh)
continue
fi
# Search directory of last generation, if any
- last="`ls -1d "$sys_target"/[0-9]* 2>/dev/null | sort -r | head -n1`"
+ last=$(ls -1d "$sys_target"/[0-9]* 2>/dev/null | sort -r | head -n1)
if [ -n "$last" ]; then
if [ ! -d "$last" ]; then
echo "Last snapshot \"$last\" seems not to be a directory!? \"$system\" skipped!"
echo; continue
fi
fi
- sys_target="$sys_target/`date +%Y%m%d-%H%M%S`"
+ sys_target="$sys_target/$(date +%Y%m%d-%H%M%S)"
if [ -n "$last" -a ! -e "$last/.stamp" ]; then
# Old backup directory without "stamp file", continue
ln -s "$sys_target" "$sys_root/latest"
fi
# Clean up old generations
- to_delete=`ls -1t "$sys_root" 2>/dev/null | tail -n+$generations | sort`
+ to_delete=$(ls -1t "$sys_root" 2>/dev/null | tail -n+$generations | sort)
if [ -n "$to_delete" -a $ok -eq 1 ]; then
[ "$DRYRUN" -eq 0 ] \
&& echo "Deleting old backup generations:" \
echo "Not deleting \"$dir\", not a backup directory!?"
continue
fi
- last=`stat "$dir/.stamp" 2>/dev/null | grep "^Modify: " \
- | cut -d':' -f2- | cut -d. -f1`
+ last=$(stat "$dir/.stamp" 2>/dev/null | grep "^Modify: " \
+ | cut -d':' -f2- | cut -d. -f1)
echo "Removing backup from" $last "..."
if [ "$DRYRUN" -eq 0 ]; then
DeleteSubvolume \