complete /mnt-mountpoint backup.
This commit is contained in:
@@ -23,37 +23,10 @@ RSYNCOPTS=""
|
||||
function beforesync() {
|
||||
# next line may be removed if you do something. bash does not like empty
|
||||
# functions
|
||||
log -s -t "calling user beforesync: mysql databases dumps..."
|
||||
|
||||
datadir=$(mysql -sN -u root -p'@Fa1952%' -e 'select @@datadir')
|
||||
# log "mysql datadir=${datadir}"
|
||||
rm -f ${datadir}/${FILTERNAME}
|
||||
|
||||
databases=($(mysql -sN -u root -p'@Fa1952%' -e "SHOW DATABASES;"))
|
||||
|
||||
for db in "${databases[@]}"
|
||||
do
|
||||
# do not backup database contents itself
|
||||
echo "- /${db}/*" >> ${datadir}/${FILTERNAME}
|
||||
log -n "${db}... "
|
||||
case "$db" in
|
||||
information_schema|performance_schema)
|
||||
log "skipped."
|
||||
;;
|
||||
*)
|
||||
log -n "dumping to ${datadir}${db}.sql... "
|
||||
mysqldump --user=root --routines ${db} > ${datadir}/${db}.sql
|
||||
log -n "compressing... "
|
||||
gzip -f ${datadir}/${db}.sql
|
||||
log "done."
|
||||
esac
|
||||
done
|
||||
# log "filtername contains:"
|
||||
# cat ${datadir}/${FILTERNAME}
|
||||
:
|
||||
}
|
||||
|
||||
function aftersync() {
|
||||
# we may remove the dump here...
|
||||
log -s -t "calling user aftersync"
|
||||
:
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user