From aba66668b4400a7ddeffd5e9f813d1a6393007f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= Date: Fri, 6 Apr 2007 18:02:22 +0000 Subject: [PATCH] skip non-existent directories so that misconfigured backups don't break other user's backups --- src/sqlbackup.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sqlbackup.sh b/src/sqlbackup.sh index 51d797dd..7f4bad8f 100755 --- a/src/sqlbackup.sh +++ b/src/sqlbackup.sh @@ -50,6 +50,10 @@ function dobck { ext="" fi i="$count" + if [ ! -d "$target_dir" ] ; then + echo "$target_dir is not a directory, skipping" >&2 + continue + fi while [ "$i" -gt 1 ]; do next_i=$(($i - 1)) mv -f "${target_dir}/${db}.sql.${next_i}${ext}" \