Commit d25579e3 authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

Bugfix and create dump for all databases

parent 8be6b861
...@@ -17,6 +17,7 @@ mkdir -p $COPY_TO ...@@ -17,6 +17,7 @@ mkdir -p $COPY_TO
function database_backup () function database_backup ()
{ {
if which mysql >/dev/null; then if which mysql >/dev/null; then
mysqldump -Q -q -e -R --add-drop-table -A -u $USER -p$PASSWORD > $COPY_TO/all.db
for db in $(echo 'SHOW DATABASES;'|mysql -u$USER -p$PASSWORD -h$HOST|grep -v '^Database$'|grep -v "^performance_schema" |grep -v "^information_schema" |grep -v "^mysql"); for db in $(echo 'SHOW DATABASES;'|mysql -u$USER -p$PASSWORD -h$HOST|grep -v '^Database$'|grep -v "^performance_schema" |grep -v "^information_schema" |grep -v "^mysql");
do do
mysqldump \ mysqldump \
......
...@@ -12,7 +12,7 @@ function sync_backup () ...@@ -12,7 +12,7 @@ function sync_backup ()
do do
if [[ $next != \#* ]]; then if [[ $next != \#* ]]; then
echo $next echo $next
rsync --dry-run -az --progress $REMOTE:$next $next rsync --dry-run -az --progress $REMOTE:$next ${next%*/*}
[[ ! $? -eq 0 ]] && read [[ ! $? -eq 0 ]] && read
fi fi
done done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment