plantage de sqlbackup du fait des 'mv' qui peuvent echouer et du set -e

This commit is contained in:
Benjamin Sonntag 2006-05-04 16:42:14 +00:00
parent a4252aa9ac
commit 80c65668a9
1 changed files with 2 additions and 2 deletions

View File

@ -53,11 +53,11 @@ function dobck {
while [ "$i" -gt 1 ]; do
next_i=$(($i - 1))
mv -f "${target_dir}/${db}.sql.${next_i}${ext}" \
"${target_dir}/${db}.sql.${i}${ext}" 2>/dev/null
"${target_dir}/${db}.sql.${i}${ext}" 2>/dev/null && true
i=$next_i # loop should end here
done
mv -f "${target_dir}/${db}.sql${ext}" \
"${target_dir}/${db}.sql.${i}${ext}" 2>/dev/null
"${target_dir}/${db}.sql.${i}${ext}" 2>/dev/null && true
if [ "$compressed" -eq 1 ]; then
mysqldump -h"$MYSQL_HOST" -u"$login" -p"$pass" "$db" --add-drop-table --allow-keywords -Q -f -q -a -e |
gzip -c > "${target_dir}/${db}.sql${ext}"