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
Custom issue tracker
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
Liberate
backupninja
Commits
2ae95a49
Commit
2ae95a49
authored
20 years ago
by
elijah
Browse files
Options
Downloads
Patches
Plain Diff
added --run, fix to __star__
parent
3390478c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
backupninja
+15
-7
15 additions, 7 deletions
backupninja
with
15 additions
and
7 deletions
backupninja
+
15
−
7
View file @
2ae95a49
...
...
@@ -31,7 +31,7 @@ function setupcolors() {
}
function
colorize
()
{
if
[
"
$usecolor
"
==
"yes"
]
;
then
if
[
"
$usecolor
s
"
==
"yes"
]
;
then
local
typestr
=
`
echo
"
$@
"
|
sed
's/\(^[^:]*\).*$/\1/'
`
[
"
$typestr
"
==
"Debug"
]
&&
type
=
0
[
"
$typestr
"
==
"Info"
]
&&
type
=
1
...
...
@@ -58,7 +58,7 @@ function colorize() {
# used to capture output from handlers
echo_debug_msg
=
0
usecolor
=
yes
usecolor
s
=
yes
function
printmsg
()
{
[
${#
@
}
-gt
1
]
||
return
...
...
@@ -143,6 +143,7 @@ function getconf() {
# replace * with %, so that it is not globbed.
ret
=
"
${
ret
//\\*/__star__
}
"
ret
=
"
${
ret
//\*/__star__
}
"
# this is weird, but single quotes are needed to
# allow for returned values with spaces. $ret is still expanded
...
...
@@ -238,6 +239,7 @@ The following options are available:
-t, --test Run in test mode, no actions are actually taken.
-n, --now Perform actions now, instead of when they
might be scheduled.
--run FILE Execute the specified action file and then exit.
When using colored output, there are:
EOF
debug
=
1
...
...
@@ -352,11 +354,11 @@ while [ $# -ge 1 ]; do
# we shift here to avoid processing the file path
shift
;;
--run
)
--run
)
debug
=
1
if
[
-f
$2
]
;
then
singlerun
=
$2
processnow
=
1
debug
=
1
else
fatal
"--run option must be fallowed by a backupninja action file"
usage
...
...
@@ -364,13 +366,19 @@ while [ $# -ge 1 ]; do
shift
;;
*
)
debug
=
1
fatal
"Unknown option
$1
"
usage
exit
;;
esac
shift
done
#if [ $debug ]; then
# usercolors=yes
#fi
## Load and confirm basic configuration values
# bootstrap
...
...
@@ -420,11 +428,11 @@ errormsg=""
if
[
"
$singlerun
"
]
;
then
files
=
$singlerun
else
files
=
`
ls
$configdirectory
`
files
=
`
find
$configdirectory
-mindepth
1
`
fi
for
file
in
$files
;
do
[
-f
$file
]
||
continue
;
[
-f
"
$file
"
]
||
continue
check_perms
$file
suffix
=
"
${
file
##*.
}
"
...
...
@@ -441,7 +449,7 @@ for file in $files; do
msg
"*missing handler* --
$file
"
fi
done
## mail the messages to the report address
if
[
$actions_run
==
0
]
;
then
doit
=
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