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
Package registry
Model registry
Operate
Terraform modules
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
Andrew Bezella
backupninja
Commits
25c3a9f4
Commit
25c3a9f4
authored
4 years ago
by
Jérôme Charaoui
Browse files
Options
Downloads
Patches
Plain Diff
improve error handling around reporthost feature
parent
f6870a61
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
src/backupninja.in
+18
-2
18 additions, 2 deletions
src/backupninja.in
with
19 additions
and
2 deletions
CHANGELOG.md
+
1
−
0
View file @
25c3a9f4
...
...
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
-
[core] silence exit code message unless --debug is used
-
[core] backup halt should trigger email report if enabled
-
[core] wrap report email body to 1000 characters by default (DEBBUG-871793)
-
[core] improve error handling around reporthost feature
## [1.2.0] - 2021-01-21
...
...
This diff is collapsed.
Click to expand it.
src/backupninja.in
+
18
−
2
View file @
25c3a9f4
...
...
@@ -652,8 +652,24 @@ if [ $actions_run != 0 ]; then
fi
if
[
-n
"
$reporthost
"
]
;
then
debug
"send
$logfile
to
$reportuser
@
$reporthost
:
$reportdirectory
"
rsync
-qt
$logfile
$reportuser
@
$reporthost
:
$reportdirectory
if
[
-z
"
$reportuser
"
]
||
[
-z
"
$reportdirectory
"
]
;
then
error
"Unable to send report, reportuser and reportdirectory must be specified."
let
"errors += 1"
elif
[
!
-x
"
$(
which rsync 2>/dev/null
)
"
]
;
then
error
"Unable to locate rsync executable, report could not be sent to
${
reporthost
}
."
let
"errors += 1"
else
info
"Sending
$logfile
to
$reportuser
@
$reporthost
:
$reportdirectory
"
execstr
=
"rsync -qt
$logfile
$reportuser
@
$reporthost
:
$reportdirectory
"
debug
$execstr
output
=
$(
eval
$execstr
2>&1
)
ret
=
$?
if
[
$ret
-ne
0
]
;
then
error
$output
error
"An error was encountered attempting to send report to
${
reporthost
}
."
let
"errors += 1"
fi
fi
fi
# return exit code
...
...
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