Open main menu

Changes

42 bytes added ,  06:54, 9 October 2019
add single-transaction switch
# note that i is naked because $(( expression )) is arithmetic expansion in bash
done
if /usr/bin/mysqldump --single-transaction "$DB" > "$backup"; then
echo "backup created successfully"
ls -al "$backup";
One of many ways to dump a database from one machine to another
<source lang="bash">
sudo mysqldump --single-transaction mydb | gzip -c | ssh ubuntu@10.0.50.53 'cat > /home/ubuntu/mydb.dump.sql.gz'
</source>