Compare commits

..

No commits in common. "d8471e5b4baa088db9cdc22a5b56e3f01186f542" and "0f2ef55f1e1beb36264be3e1c4e574f5ee7e6373" have entirely different histories.

View File

@ -17,16 +17,11 @@ if [ $exit_status_volume_inspect -eq 0 ]; then
echo "Create volume $volume_name" echo "Create volume $volume_name"
docker volume create "$volume_name" docker volume create "$volume_name"
fi fi
if [ ! -d "$backup_files" ]; then
if [ -f "$backup_sql" ]; then if [ ! -f "$backup_sql" ]; then
echo "recover mysql dump" echo "ERROR: $backup_files and $backup_sql don't exist"
cat $backup_sql | docker exec -i "$container" /usr/bin/mysql -u root --password="$mysql_root_password" $database exit 1
exit 0
else
if [ -d "$backup_files" ]; then
echo "recover files"
docker run --rm -v "$volume_name:/recover/" -v "$backup_files:/backup/" "kevinveenbirkenbach/alpine-rsync" sh -c "rsync -avv --delete /backup/ /recover/"
fi fi
cat $backup_sql | docker exec -i "$container" '/usr/bin/mysql -u root --password="'$mysql_root_password'" "'$database'"'
fi fi
echo "ERROR: $backup_files and $backup_sql don't exist" docker run --rm -v "$volume_name:/recover/" -v "$backup_files:/backup/" "kevinveenbirkenbach/alpine-rsync" sh -c "rsync -avv --delete /backup/ /recover/"
exit 1