mirror of
https://github.com/ChrisSewell/MySQL-backup-to-Amazon-S3.git
synced 2025-07-01 18:47:26 -04:00
add tmp path
This commit is contained in:
@ -9,6 +9,8 @@ MYSQLPASS=password
|
||||
S3BUCKET=my-db-backup-bucket
|
||||
# when running via cron, the PATHs MIGHT be different. If you have a custom/manual MYSQL install, you should set this manually like MYSQLDUMPPATH=/usr/local/mysql/bin/
|
||||
MYSQLDUMPPATH=
|
||||
#tmp path.
|
||||
TMP_PATH=~/
|
||||
|
||||
PERIOD=${1-day}
|
||||
|
||||
@ -17,7 +19,7 @@ echo "Selected period: $PERIOD."
|
||||
echo "Starting backing up the database to a file..."
|
||||
|
||||
# dump all databases
|
||||
${MYSQLDUMPPATH}mysqldump --quick --user=${MYSQLROOT} --password=${MYSQLPASS} --all-databases > ~/all-databases.sql
|
||||
${MYSQLDUMPPATH}mysqldump --quick --user=${MYSQLROOT} --password=${MYSQLPASS} --all-databases > ${TMP_PATH}all-databases.sql
|
||||
|
||||
echo "Done backing up the database to a file."
|
||||
echo "Starting compression..."
|
||||
@ -45,4 +47,4 @@ echo "Removing the cache files..."
|
||||
rm ~/all-databases.sql
|
||||
rm ~/all-databases.tar.gz
|
||||
echo "Files removed."
|
||||
echo "All done."
|
||||
echo "All done."
|
||||
|
Reference in New Issue
Block a user