Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
awit-dbackup
awit-dbackup
Commits
0665ee08
Commit
0665ee08
authored
Jan 13, 2012
by
Nigel Kukard
Browse files
Merge branch 'master' into v0.0.x
Conflicts: dbackup
parents
bd479137
422ad8a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
dbackup
View file @
0665ee08
...
...
@@ -43,7 +43,7 @@ use MIME::Base64;
my
$VERSION
=
"
0.0.15
";
# System dirs we don't care about
my
@defaultSystemExcl
=
("
/dev
","
/run
","
/proc
","
/sys
","
/tmp
","
/var/tmp
");
my
@defaultSystemExcl
=
("
/dev
","
/run
","
/proc
","
/sys
","
/tmp
","
/var/tmp
"
,"
/misc
","
/media
","
/mnt
"
);
# These should be backed up separately
my
@defaultDataExcl
=
(
"
/var/lib/mysql
","
/var/lib/pgsql
",
...
...
@@ -111,6 +111,8 @@ GetOptions(\%optctl,
"
system-base=s@
",
"
system-dir=s@
",
"
tar-ignore-failed-read=s@
",
"
exclude-data
",
"
data-dir=s@
",
...
...
@@ -197,6 +199,12 @@ if (!defined($config{'system-dir'})) {
$config
{'
system-dir
'}
=
toArray
(
$config
{'
system-dir
'});
}
if
(
!
defined
(
$config
{'
tar-ignore-failed-read
'}))
{
$config
{'
tar-ignore-failed-read
'}
=
[]
;
}
else
{
$config
{'
tar-ignore-failed-read
'}
=
toArray
(
$config
{'
tar-ignore-failed-read
'});
}
if
(
!
defined
(
$config
{'
data-dir
'}))
{
$config
{'
data-dir
'}
=
[]
;
}
else
{
...
...
@@ -284,6 +292,10 @@ if (defined($optctl{'system-dir'})) {
push
(
@
{
$config
{'
system-dir
'}},
@
{
$optctl
{'
system-dir
'}});
}
if
(
defined
(
$optctl
{'
tar-ignore-failed-read
'}))
{
push
(
@
{
$config
{'
tar-ignore-failed-read
'}},
@
{
$optctl
{'
tar-ignore-failed-read
'}});
}
if
(
defined
(
$optctl
{'
data-dir
'}))
{
push
(
@
{
$config
{'
data-dir
'}},
@
{
$optctl
{'
data-dir
'}});
}
...
...
@@ -534,6 +546,11 @@ sub backup
$srcDirList
{
$path
}
->
{
$item
}
->
{'
mode
'}
=
$mode
;
return
;
# Check if we're a socket
}
elsif
(
S_ISSOCK
(
$mode
))
{
# Blatently ignore...
return
;
}
# Initialize file state
...
...
@@ -761,6 +778,18 @@ sub backup
}
close
(
MANIFEST
);
# tar specifics...
if
(
$newPathAttribs
{
$path
}
->
{'
format
'}
eq
"
tar
")
{
# Exclude paths for tar-ignore-failed-read
foreach
my
$item
(
@
{
$config
{'
tar-ignore-failed-read
'}})
{
# Check...
if
("
/
$path
"
eq
$item
)
{
printLog
(
LOG_NOTICE
,"
B: Path '[
$source
]/
$path
' ignore-failed-read passed to tar
\n
");
push
(
@tarArgs
,"
--ignore-failed-read
",
$path
);
}
}
}
# Change dir and start backup
system
(
"
tar
",
...
...
@@ -1246,6 +1275,10 @@ Usage: $0 [args] <src> <dst>
--
system
-
base
=
path
Add
a
system
base
.
This
defaults
to
/
and
this
option
will
override
that
.
--
tar
-
ignore
-
failed
-
read
=
path
This
is
passed
to
tar
only
.
It
will
not
cause
errors
of
files
that
cannot
be
read
for
the
path
matched
.
Restore
Options:
--
restore
|-
r
Restore
src
to
dst
.
--
tar
-
keep
-
newer
Do
not
overwrite
newer
files
.
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment