simplify commandline creation

This commit is contained in:
Antoine Beaupré 2008-07-10 21:49:22 +00:00
parent 0aebaa3c07
commit c2039cf504
1 changed files with 8 additions and 21 deletions

View File

@ -245,33 +245,20 @@ function dobck() {
# those 2 options avoid insert during dump which can create an unconsistent # those 2 options avoid insert during dump which can create an unconsistent
# state of the database backup # state of the database backup
# remove because lock is allow for alternc user # remove because lock is allow for alternc user
if [ "$compressed" -eq 1 ] && [ "$DO_BACKUP" == "YES" ]; then if [ "$DO_BACKUP" == "YES" ]; then
debug "msqldump -h\"$MYSQL_HOST\" -u\"$login\" -p\"XXXX\" \"$db\" --add-drop-table --allow-keywords -Q -f -q -a -e \ " $command = mysqldump -h"$MYSQL_HOST" -u"$login" -p"$pass" "$db" \
debug " | gzip -c > \"${target_dir}/${name_backup_file}.sql${ext}\""
mysqldump -h"$MYSQL_HOST" -u"$login" -p"$pass" "$db" \
--add-drop-table \ --add-drop-table \
--allow-keywords \ --allow-keywords \
--quote-names \ --quote-names \
--force \ --force \
--quick \ --quick \
--all \ --all \
--extended-insert \ --extended-insert
| gzip -c > "${target_dir}/${name_backup_file}.sql${ext}" if [ "$compressed" -eq 1 ] ; then
$command = "$command | gzip -c"
elif [ "$DO_BACKUP" == "YES" ] ; then fi
debug "mysqldump -h\"$MYSQL_HOST\" -u\"$login\" -p\"XXXX\" \"$db\" --add-drop-table --allow-keywords -Q -f -q -a -e \ " debug "$command > ${target_dir}/${name_backup_file}.sql${ext}"
debug " > \"${target_dir}/${name_backup_file}.sql\"" $command > "${target_dir}/${name_backup_file}.sql${ext}"
mysqldump -h"$MYSQL_HOST" -u"$login" -p"$pass" "$db" \
--add-drop-table \
--allow-keywords \
--quote-names \
--force \
--quick \
--all \
--extended-insert \
> "${target_dir}/${name_backup_file}.sql"
fi fi
IFS=" " IFS=" "