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
27387185
Commit
27387185
authored
20 years ago
by
elijah
Browse files
Options
Downloads
Patches
Plain Diff
added reportsuccess and reportwarning config options.
parent
9f6af22a
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
backupninja
+16
-5
16 additions, 5 deletions
backupninja
etc/backupninja.conf
+12
-3
12 additions, 3 deletions
etc/backupninja.conf
with
28 additions
and
8 deletions
backupninja
+
16
−
5
View file @
27387185
...
...
@@ -192,6 +192,8 @@ setfile $CONFFILE
# get global config options (second param is the default)
getconf configdirectory /etc/backup.d
getconf reportemail
getconf reportsuccess
yes
getconf reportwarning
yes
getconf loglevel 3
getconf logfile /var/log/backupninja.log
getconf SLAPCAT /usr/sbin/slapcat
...
...
@@ -211,7 +213,9 @@ debug 1 "====== starting at "`date`" ======"
# by default, don't make files which are world or group readable.
umask
077
for
file
in
$configdirectory
/
*
;
do
for
file
in
$configdirectory
/
*
;
do
[
-f
$file
]
||
continue
;
perms
=
`
ls
-ld
$file
`
perms
=
${
perms
:4:6
}
if
[
"
$perms
"
!=
"------"
]
;
then
...
...
@@ -238,10 +242,10 @@ for file in $configdirectory/*; do
errors
=
`
echo
$ret
|
grep
-e
"^Error:
\|
^Fatal: "
|
wc
-l
`
if
[
$errors
!=
0
]
;
then
msg
"*failed* --
$file
"
error
=
"
$error
\n
== errors from
$file
==
\n\n
$ret
\n
"
error
msg
=
"
$error
\n
== errors from
$file
==
\n\n
$ret
\n
"
elif
[
$warnings
!=
0
]
;
then
msg
"*warning* --
$file
"
error
=
"
$error
\n
== warnings from
$file
==
\n\n
$ret
\n
"
error
msg
=
"
$error
\n
== warnings from
$file
==
\n\n
$ret
\n
"
elif
[
$retcode
==
0
]
;
then
msg
"success --
$file
"
else
...
...
@@ -256,13 +260,20 @@ done
## mail the messages to the report address
if
[
"
$reportemail
"
!=
""
]
;
then
if
[
"
$reportemail
"
==
""
]
;
then
doit
=
0
elif
[
$errors
!=
0
]
;
then
doit
=
1
elif
[
"
$reportsuccess
"
==
"yes"
]
;
then
doit
=
1
elif
[
"
$reportwarning
"
==
"yes"
-a
$warnings
!=
0
]
;
then
doit
=
1
else
doit
=
0
fi
if
[
$doit
==
1
]
;
then
hostname
=
`
hostname
`
{
for
((
i
=
0
;
i <
${#
messages
[@]
}
;
i++
))
;
do
echo
${
messages
[
$i
]
}
done
echo
-e
"
$error
"
echo
-e
"
$error
msg
"
}
| mail
$reportemail
-s
"backupninja:
$hostname
"
fi
...
...
This diff is collapsed.
Click to expand it.
etc/backupninja.conf
+
12
−
3
View file @
27387185
...
...
@@ -6,15 +6,24 @@
#
# how verbose to make the logs
# 5 -- Debugging messages
(and below)
# 5 -- Debugging messages (and below)
# 4 -- Informational messages (and below)
# 3 -- Warnings (and below)
# 2 -- Errors (and below)
# 1 -- Fatal errors (only)
loglevel
=
4
# send a summary of backup status to this email address
# reportemail = root
# send a summary of the backup status to
# this email address:
reportemail
=
root
# if set to 'yes', a report email will be generated
# even if all modules reported success. (default = yes)
reportsuccess
=
yes
# if set to 'yes', a report email will be generated
# even if there was no error. (default = yes)
reportwarning
=
yes
#######################################################
# for most installations, the defaults below are good #
...
...
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