MT#57270 Don't wipe sql dump header

For sql dump we need to setup some variable like FOREIGN_KEY_CHECKS=0,
or NAMES utf8 as well as 'CREATE DATABASE' statement. And we do but then
it's wiped due to incorrect redirection '>' instead of '>>'. So fix it.

Change-Id: Id37153d5e4ac038f788c34443e1bb5715d5e3985
mr11.4
Mykola Malkov 3 years ago
parent f6c799c03b
commit bee375ae8b

@ -101,7 +101,7 @@ for schema in "${schemes[@]}"; do
mysqldump "${schema}" --compact --skip-extended-insert \ mysqldump "${schema}" --compact --skip-extended-insert \
-S "${mariadb_dir}/mysqld.sock" \ -S "${mariadb_dir}/mysqld.sock" \
| sed -r "s/'[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2} [[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}'/NOW()/g" \ | sed -r "s/'[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2} [[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}'/NOW()/g" \
> "${schema}.sql" >> "${schema}.sql"
echo "Done" echo "Done"
done done

Loading…
Cancel
Save