fixes all errors

This commit is contained in:
mirocow 2016-02-16 15:26:09 +04:00
parent db9e0568da
commit 2b09c15dab
1 changed files with 9 additions and 2 deletions

View File

@ -108,13 +108,20 @@ restore()
if [ -f "$DIR/$BDD/$TABLE.txt" ]; then
f_log "+ $TABLE"
split -l $CONFIG_CHUNK "$DIR/$BDD/$TABLE.txt" ${TABLE}_part_
split -l $CONFIG_CHUNK "$DIR/$BDD/$TABLE.txt" "$DIR/$BDD/${TABLE}_part_"
for segment in ${TABLE}_part_*; do
time mysql --defaults-extra-file=$CONFIG_FILE $BDD --local-infile -e "SET foreign_key_checks = 0; SET unique_checks = 0; SET sql_log_bin = 0;
LOAD DATA LOCAL INFILE '$DIR/$BDD/$segment'
INTO TABLE $TABLE;
SET foreign_key_checks = 1; SET unique_checks = 1; SET sql_log_bin = 1;"
done
done
if [ -f "$DIR/$BDD/$segment" ]; then
f_log "Delete segment $segment"
rm "$DIR/$BDD/$segment"
fi
if [ ! -f "$DIR/$BDD/$TABLE.txt.bz2" ]; then
f_log "> $TABLE"
bzip2 $DIR/$BDD/$TABLE.txt