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
299a5307
Commit
299a5307
authored
19 years ago
by
intrigeri
Browse files
Options
Downloads
Patches
Plain Diff
lib/vserver.in: new function: vservers_exist
handlers/dup: make use of new lib/vserver functionality
parent
96023985
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
ChangeLog
+2
-0
2 additions, 0 deletions
ChangeLog
handlers/dup
+15
-24
15 additions, 24 deletions
handlers/dup
lib/vserver.in
+22
-1
22 additions, 1 deletion
lib/vserver.in
with
39 additions
and
25 deletions
ChangeLog
+
2
−
0
View file @
299a5307
...
...
@@ -16,6 +16,7 @@ version 0.9.3 -- unreleased
disabled in backupninja.conf
. now works when multiple vservers names are given (separated by space)
in vsnames config variable
. make use of new lib/vserver functionality
ninjahelper changes
rdiff.helper:
. fixed errors in create remote dir
...
...
@@ -33,6 +34,7 @@ version 0.9.3 -- unreleased
. init_vservers: canonicalize VROOTDIR (since duplicity et al.
don't follow symlinks)
. init_vservers: warn if vservers are enabled but no vserver is found
. new function: vservers_exist
known bugs:
easydialog:
. formDisplay does not return exit status.
...
...
This diff is collapsed.
Click to expand it.
handlers/dup
+
15
−
24
View file @
299a5307
...
...
@@ -34,28 +34,19 @@ destdir=${destdir%/}
[
"
$include
"
!=
""
]
||
fatal
"No source includes specified"
### vservers stuff ###
# See if vservers are configured.
# If so, check that the ones listed in $vsnames do exist.
if
[
"
$vservers
"
==
"yes"
]
;
then
[
-d
"
$VROOTDIR
"
]
||
fatal
"vservers enabled, but
$VROOTDIR
does not exist!"
if
[
"
$vsnames
"
==
"all"
]
;
then
vsnames
=
""
for
vserver
in
`
ls
$VROOTDIR
|
grep
-E
-v
"lost+found|ARCHIVES"
`
;
do
vsnames
=
"
$vserver
$vsnames
"
done
local
usevserver
=
no
# If vservers are configured, check that the ones listed in $vsnames do exist.
if
[
$vservers_are_available
=
yes
]
;
then
if
[
"
$vsnames
"
=
all
]
;
then
vsnames
=
"
$found_vservers
"
else
for
vserver
in
$vsnames
;
do
[
-d
"
$VROOTDIR
/
$vserver
"
]
||
fatal
"vserver '
$vserver
'
does not exist."
done
if
!
vservers_exist
"
$vsnames
"
;
then
fatal
"At least one of the vservers listed in vsnames (
$vsnames
)
does not exist."
fi
fi
if
[
-n
"
$vsnames
"
]
;
then
if
[
-n
"
$vsinclude
"
]
;
then
info
"Using vservers '
$vsnames
'"
usevserver
=
1
fi
else
[
-z
"
$vsinclude
"
]
||
warning
'vsnames is empty, vsinclude configuration lines will be ignored'
usevserver
=
yes
fi
else
[
-z
"
$vsinclude
"
]
||
warning
'vservers support disabled in backupninja.conf, vsincludes configuration lines will be ignored'
...
...
@@ -135,7 +126,7 @@ for i in "$include"; do
done
# vsincludes
if
[
$usevserver
]
;
then
if
[
$usevserver
=
yes
]
;
then
for
vserver
in
$vsnames
;
do
for
vi
in
"
$vsinclude
"
;
do
str
=
"
${
vi
//__star__/*
}
"
...
...
This diff is collapsed.
Click to expand it.
lib/vserver.in
+
22
−
1
View file @
299a5307
...
...
@@ -74,7 +74,28 @@ init_vservers() {
}
##
## If the argument is the name of a vserver selected use by the current helper,
## If all the arguments are existing vservers names, returns 0.
## Else, returns 1. Also returns 1 if no argument is given.
##
vservers_exist
()
{
[
$#
-ge
1
]
||
return
1
local
args
=
"
$1
"
local
vserver i found
for
vserver
in
$args
;
do
found
=
no
for
i
in
$found_vservers
;
do
if
[
$vserver
=
$i
]
;
then
found
=
yes
break
fi
done
[
$found
=
yes
]
||
return
1
done
return
0
}
##
## If the argument is the name of a vserver selected by the current helper,
## echoes 'on' and returns 0.
## Else, echoes 'off' and returns 1.
##
...
...
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