diff --git a/restore.sh b/restore.sh index 8d5e53b..c99fa91 100755 --- a/restore.sh +++ b/restore.sh @@ -116,13 +116,13 @@ restore() LOAD DATA LOCAL INFILE '$segment' INTO TABLE $TABLE; SET foreign_key_checks = 1; SET unique_checks = 1; SET sql_log_bin = 1;" + + if [ -f "$segment" ]; then + f_log "Delete segment $segment" + rm "$segment" + fi done - if [ -f "$segment" ]; then - f_log "Delete segment $segment" - rm "$segment" - fi - if [ ! -f "$DIR/$BDD/$TABLE.txt.bz2" ]; then f_log "> $TABLE" bzip2 $DIR/$BDD/$TABLE.txt