skip non-existent directories so that misconfigured backups don't break other user's backups

This commit is contained in:
Antoine Beaupré 2007-04-06 18:02:22 +00:00
parent 363aa93f1a
commit aba66668b4
1 changed files with 4 additions and 0 deletions

View File

@ -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}" \