#!/bin/bash
TARGET_FILE=backupdb.sql
printf "Dumping database\n"

if test -f "$TARGET_FILE"
then
  echo "Removing $TARGET_FILE"
  sudo rm "$TARGET_FILE"
fi
echo "Creating $TARGET_FILE"
mysqldump --hex-blob --max_allowed_packet=64M --default-character-set=utf8mb4 --databases market_data portfolio_data user_data --user=root --password=dbas --master-data > "$TARGET_FILE"
