Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iml-backup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
iml-backup
Commits
1903e664
Commit
1903e664
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
add counters for new/ changed/ deleted fileobjects
parent
adf7f500
No related branches found
No related tags found
1 merge request
!113
add counters for new/ changed/ deleted fileobjects
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
check_clientbackup.sh
+19
-1
19 additions, 1 deletion
check_clientbackup.sh
with
19 additions
and
1 deletion
check_clientbackup.sh
+
19
−
1
View file @
1903e664
...
...
@@ -16,6 +16,7 @@
# 2022-02-09 ah v1.2 update after changes in logging
# 2022-10-07 ah v1.3 unescape regex with space to prevent "grep: warning: stray \ before white space"
# 2022-10-20 ah v1.4 show last backup, prune and verify
# 2023-09-01 ah v1.5 add counters for new/ changed/ deleted fileobjects (Restic only)
# ==============================================================================
.
$(
dirname
$0
)
/jobhelper.sh
...
...
@@ -142,13 +143,30 @@ else
if
[
$flagShowChangedFiles
-ne
0
]
;
then
sSearch
=
"Args:|ElapsedTime|SourceFiles|SourceFileSize|RawDeltaSize"
if
echo
"
$logfile
"
|
grep
-E
"(inc|auto)"
>
/dev/null
;
then
sSearch
=
"[
AD
M] |
${
sSearch
}
"
sSearch
=
"[
+-
M] |
${
sSearch
}
"
fi
echo
">>> Changes:"
grep
-E
"^(
${
sSearch
}
)"
$logfile
|
cut
-f
2-
-d
':'
echo
fi
if
cat
$logfile
|
grep
restic
>
/dev/null
;
then
echo
">>> Counters:"
iModFNew
=
$(
cat
$logfile
|
grep
-c
"^+ /.*[^/]$"
)
iModDNew
=
$(
cat
$logfile
|
grep
-c
"^+ /.*/$"
)
iModFChange
=
$(
cat
$logfile
|
grep
-c
"^M /.*[^/]$"
)
iModDChange
=
$(
cat
$logfile
|
grep
-c
"^M /.*/$"
)
iModFDelete
=
$(
cat
$logfile
|
grep
-c
"^- /.*[^/]$"
)
iModDDelete
=
$(
cat
$logfile
|
grep
-c
"^- /.*/$"
)
printf
"__COUNTERS__New: %10s files %10s dirs
\n
"
$iModFNew
$iModDNew
printf
"__COUNTERS__Changed: %10s files %10s dirs
\n
"
$iModFChange
$iModDChange
printf
"__COUNTERS__Deleted: %10s files %10s dirs
\n
"
$iModFDelete
$iModDDelete
echo
"__PERFDATA__ |files-new=
$iModFNew
;;;0|files-mod=
$iModFChange
;;;0|files-del=
$iModFDelete
|dirs-new=
$iModDNew
;;;0|dirs-mod=
$iModDChange
;;;0|dirs-del=
$iModDDelete
"
echo
fi
echo
">>> Summary of database backup actions:"
cat
$logfile
|
grep
'__DB__'
| filterColor |
cut
-f
1
-d
' '
|
sort
-u
|
while
read
-r
dbprefix
do
...
...
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