Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
backupninja
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lyz
backupninja
Commits
166c4866
Commit
166c4866
authored
19 years ago
by
elijah
Browse files
Options
Downloads
Patches
Plain Diff
added patch to mysql handler from Daniel.Bonniot@inria.fr
(adds ignores option)
parent
30348c7d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog
+2
-0
2 additions, 0 deletions
changelog
handlers/mysql
+16
-7
16 additions, 7 deletions
handlers/mysql
with
18 additions
and
7 deletions
changelog
+
2
−
0
View file @
166c4866
...
@@ -29,6 +29,8 @@ version 0.8 --
...
@@ -29,6 +29,8 @@ version 0.8 --
rdiff handler now does not require 'label'
rdiff handler now does not require 'label'
changes to mysql and svn handlers' vservers support
changes to mysql and svn handlers' vservers support
these handlers now check if the source vserver is running
these handlers now check if the source vserver is running
added 'ignores' for mysql handler. (thanks Daniel.Bonniot@inria.fr)
version 0.7 -- July 26 2005
version 0.7 -- July 26 2005
added ninjahelper: a dialog based wizard for creating backupninja configs.
added ninjahelper: a dialog based wizard for creating backupninja configs.
...
...
This diff is collapsed.
Click to expand it.
handlers/mysql
+
16
−
7
View file @
166c4866
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
getconf backupdir /var/backups/mysql
getconf backupdir /var/backups/mysql
getconf databases all
getconf databases all
getconf ignores
getconf dbhost localhost
getconf dbhost localhost
getconf hotcopy no
getconf hotcopy no
getconf sqldump no
getconf sqldump no
...
@@ -25,6 +26,14 @@ else
...
@@ -25,6 +26,14 @@ else
[ -f $userhome/.my.cnf ] || fatal "Can't find config file in $userhome/.my.cnf"
[ -f $userhome/.my.cnf ] || fatal "Can't find config file in $userhome/.my.cnf"
fi
fi
## Prepare ignore part of the command
## This only works for mysqldump at the moment
ignore=''
for i in $ignores; do
ignore="$ignore --ignore-table=$i"
done
# If vservers are configured, decide if the handler should
# If vservers are configured, decide if the handler should
# use them or if it should just operate on the host
# use them or if it should just operate on the host
...
@@ -42,13 +51,13 @@ fi
...
@@ -42,13 +51,13 @@ fi
# If needed, make sure that the specified vserver exists and is running.
# If needed, make sure that the specified vserver exists and is running.
if [ $usevserver ]
if [ $usevserver ]
then
then
info "examining vserver '$vsname'"
info "examining vserver '$vsname'"
# does it exist ?
# does it exist ?
vroot="$VROOTDIR/$vsname"
vroot="$VROOTDIR/$vsname"
[ -d $vroot ] || fatal "vserver '$vsname' does not exist at '$vroot'"
[ -d $vroot ] || fatal "vserver '$vsname' does not exist at '$vroot'"
# is it running ?
# is it running ?
running=`$VSERVERINFO $vsname RUNNING`
running=`$VSERVERINFO $vsname RUNNING`
[ $running = 1 ] || fatal "vserver $vsname is not running."
[ $running = 1 ] || fatal "vserver $vsname is not running."
fi
fi
# create backup dirs, the vroot variable will be empty if no vsname was specified
# create backup dirs, the vroot variable will be empty if no vsname was specified
...
@@ -181,9 +190,9 @@ if [ "$sqldump" == "yes" ]; then
...
@@ -181,9 +190,9 @@ if [ "$sqldump" == "yes" ]; then
for db in $databases; do
for db in $databases; do
if [ $usevserver ]
if [ $usevserver ]
then
then
execstr="$VSERVER $vsname exec $MYSQLDUMP $defaultsfile --lock-tables --complete-insert --add-drop-table --quick --quote-names $db > $vroot$dumpdir/${db}.sql"
execstr="$VSERVER $vsname exec $MYSQLDUMP $defaultsfile --lock-tables --complete-insert --add-drop-table --quick --quote-names
$ignore
$db > $vroot$dumpdir/${db}.sql"
else
else
execstr="$MYSQLDUMP $defaultsfile --lock-tables --complete-insert --add-drop-table --quick --quote-names $db > $dumpdir/${db}.sql"
execstr="$MYSQLDUMP $defaultsfile --lock-tables --complete-insert --add-drop-table --quick --quote-names
$ignore
$db > $dumpdir/${db}.sql"
fi
fi
debug "su $user -c '$execstr'"
debug "su $user -c '$execstr'"
if [ ! $test ]; then
if [ ! $test ]; then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment