2024-05-17 21:33:53 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
datetime=`date +%Y%m%d%H`
|
|
|
|
|
|
|
|
mysqldump -h ${HOST} -P ${PORT} -u backup -p${PASSWORD} --single-transaction --set-gtid-purged=OFF --all-databases > bfs-application-${datetime}.sql
|
|
|
|
if (($?==0));then
|
2024-07-26 15:34:10 +08:00
|
|
|
aws s3 cp bfs-application-${datetime}.sql s3://bfs-pkg-storage/mysql/backup/
|
2024-05-17 21:33:53 +08:00
|
|
|
else
|
|
|
|
echo "Backup to failed"
|
|
|
|
exit 1
|
|
|
|
fi
|