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
b5130c49
Commit
b5130c49
authored
18 years ago
by
micah
Browse files
Options
Downloads
Patches
Plain Diff
Added in-line compression to pgsql and mysql handlers, appears to work fine in tests
parent
489e294c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ChangeLog
+2
-0
2 additions, 0 deletions
ChangeLog
handlers/mysql
+10
-9
10 additions, 9 deletions
handlers/mysql
handlers/pgsql
+20
-10
20 additions, 10 deletions
handlers/pgsql
with
32 additions
and
19 deletions
ChangeLog
+
2
−
0
View file @
b5130c49
...
@@ -15,11 +15,13 @@ version 0.9.4 -- unreleased
...
@@ -15,11 +15,13 @@ version 0.9.4 -- unreleased
. Fixed erroneous removal of tmpfile when it didn't exit
. Fixed erroneous removal of tmpfile when it didn't exit
. Fixed inversed vsname emptiness check
. Fixed inversed vsname emptiness check
. Fixed su quote usage to be more posixy
. Fixed su quote usage to be more posixy
. compress for sqldumps now happens in-line to save some disk space (Closes: #370778)
pgsql:
pgsql:
. Fixed inversed vsname emptiness check
. Fixed inversed vsname emptiness check
. Fixed su quote usage to be more posixy
. Fixed su quote usage to be more posixy
. Fixed shell expansion, thanks Thomas Kotzian (Closes: #363297)
. Fixed shell expansion, thanks Thomas Kotzian (Closes: #363297)
. postgres user UID is now the one from inside the vserver if necessary
. postgres user UID is now the one from inside the vserver if necessary
. compress now happens in-line to save some disk space (Closes: #370778)
svn:
svn:
. Fixed inversed vsname emptiness check
. Fixed inversed vsname emptiness check
rdiff:
rdiff:
...
...
This diff is collapsed.
Click to expand it.
handlers/mysql
+
10
−
9
View file @
b5130c49
...
@@ -249,9 +249,17 @@ fi
...
@@ -249,9 +249,17 @@ fi
do
do
if
[
$usevserver
=
yes
]
if
[
$usevserver
=
yes
]
then
then
execstr
=
"
$VSERVER
$vsname
exec
$MYSQLDUMP
$defaultsfile
--lock-tables --complete-insert --add-drop-table --quick --quote-names
$ignore
$db
>
$vroot$dumpdir
/
${
db
}
.sql"
if
[
"
$compress
"
==
"yes"
]
;
then
execstr
=
"
$VSERVER
$vsname
exec
$MYSQLDUMP
$defaultsfile
--lock-tables --complete-insert --add-drop-table --quick --quote-names
$ignore
$db
|
$GZIP
>
$vroot$dumpdir
/
${
db
}
.sql.gz"
else
execstr
=
"
$VSERVER
$vsname
exec
$MYSQLDUMP
$defaultsfile
--lock-tables --complete-insert --add-drop-table --quick --quote-names
$ignore
$db
>
$vroot$dumpdir
/
${
db
}
.sql"
fi
else
else
execstr
=
"
$MYSQLDUMP
$defaultsfile
--lock-tables --complete-insert --add-drop-table --quick --quote-names
$ignore
$db
>
$dumpdir
/
${
db
}
.sql"
if
[
"
$compress
"
==
"yes"
]
;
then
execstr
=
"
$MYSQLDUMP
$defaultsfile
--lock-tables --complete-insert --add-drop-table --quick --quote-names
$ignore
$db
|
$GZIP
>
$dumpdir
/
${
db
}
.sql.gz"
else
execstr
=
"
$MYSQLDUMP
$defaultsfile
--lock-tables --complete-insert --add-drop-table --quick --quote-names
$ignore
$db
>
$dumpdir
/
${
db
}
.sql"
fi
fi
fi
debug
"su
$user
-c
\"
$execstr
\"
"
debug
"su
$user
-c
\"
$execstr
\"
"
if
[
!
$test
]
if
[
!
$test
]
...
@@ -268,13 +276,6 @@ fi
...
@@ -268,13 +276,6 @@ fi
fi
fi
fi
fi
done
done
if
[
"
$compress
"
==
"yes"
]
then
output
=
`
$GZIP
-f
$vroot$dumpdir
/
*
.sql 2>&1
`
debug
$output
fi
fi
# clean up tmp config file
# clean up tmp config file
if
[
"
$dbusername
"
!=
""
-a
"
$dbpassword
"
!=
""
]
if
[
"
$dbusername
"
!=
""
-a
"
$dbpassword
"
!=
""
]
...
...
This diff is collapsed.
Click to expand it.
handlers/pgsql
+
20
−
10
View file @
b5130c49
...
@@ -76,9 +76,17 @@ chmod 700 $vroot$backupdir
...
@@ -76,9 +76,17 @@ chmod 700 $vroot$backupdir
# if $databases = all, use pg_dumpall
# if $databases = all, use pg_dumpall
if
[
"
$databases
"
==
"all"
]
;
then
if
[
"
$databases
"
==
"all"
]
;
then
if
[
$usevserver
=
yes
]
;
then
if
[
$usevserver
=
yes
]
;
then
execstr
=
"
$VSERVER
$vsname
exec su - postgres -c
\"
$PGSQLDUMPALL
>
$backupdir
/
${
vsname
}
.sql
\"
"
if
[
"
$compress
"
==
"yes"
]
;
then
execstr
=
"
$VSERVER
$vsname
exec su - postgres -c
\"
$PGSQLDUMPALL
|
$GZIP
>
$backupdir
/
${
vsname
}
.sql.gz
\"
"
else
execstr
=
"
$VSERVER
$vsname
exec su - postgres -c
\"
$PGSQLDUMPALL
>
$backupdir
/
${
vsname
}
.sql
\"
"
fi
else
else
if
[
"
$compress
"
==
"yes"
]
;
then
execstr
=
"su - postgres -c
\"
$PGSQLDUMPALL
|
$GZIP
>
$backupdir
/
${
localhost
}
-all.sql.gz
\"
"
else
execstr
=
"su - postgres -c
\"
$PGSQLDUMPALL
>
$backupdir
/
${
localhost
}
-all.sql
\"
"
execstr
=
"su - postgres -c
\"
$PGSQLDUMPALL
>
$backupdir
/
${
localhost
}
-all.sql
\"
"
fi
fi
fi
debug
"
$execstr
"
debug
"
$execstr
"
if
[
!
$test
]
;
then
if
[
!
$test
]
;
then
...
@@ -96,11 +104,18 @@ if [ "$databases" == "all" ]; then
...
@@ -96,11 +104,18 @@ if [ "$databases" == "all" ]; then
# else use pg_dump on each specified database
# else use pg_dump on each specified database
else
else
for
db
in
$databases
;
do
for
db
in
$databases
;
do
if
[
$usevserver
=
yes
]
if
[
$usevserver
=
yes
]
;
then
then
if
[
"
$compress
"
==
"yes"
]
;
then
execstr
=
"
$VSERVER
$vsname
exec su - postgres -c
\"
$PGSQLDUMP
$db
>
$backupdir
/
${
db
}
.sql
\"
"
execstr
=
"
$VSERVER
$vsname
exec su - postgres -c
\"
$PGSQLDUMP
$db
|
$GZIP
>
$backupdir
/
${
db
}
.sql.gz
\"
"
else
execstr
=
"
$VSERVER
$vsname
exec su - postgres -c
\"
$PGSQLDUMP
$db
| >
$backupdir
/
${
db
}
.sql
\"
"
fi
else
else
execstr
=
"su - postgres -c
\"
$PGSQLDUMP
$db
>
$backupdir
/
${
db
}
.sql
\"
"
if
[
"
$compress
"
==
"yes"
]
;
then
execstr
=
"su - postgres -c
\"
$PGSQLDUMP
$db
|
$GZIP
>
$backupdir
/
${
db
}
.sql.gz
\"
"
else
execstr
=
"su - postgres -c
\"
$PGSQLDUMP
$db
>
$backupdir
/
${
db
}
.sql
\"
"
fi
fi
fi
debug
"
$execstr
"
debug
"
$execstr
"
if
[
!
$test
]
;
then
if
[
!
$test
]
;
then
...
@@ -117,10 +132,5 @@ else
...
@@ -117,10 +132,5 @@ else
done
done
fi
fi
if
[
"
$compress
"
==
"yes"
]
;
then
output
=
`
$GZIP
-f
$vroot$backupdir
/
*
.sql 2>&1
`
debug
$output
fi
return
0
return
0
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