Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
infrastructure
Commits
0edc4292
Verified
Commit
0edc4292
authored
Jun 24, 2021
by
Evangelos Foutras
🐱
Browse files
Monitor borg repo sizes
parent
90a51d33
Pipeline
#8905
passed with stage
in 56 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
roles/prometheus_exporters/files/borg-textcollector.sh
View file @
0edc4292
...
...
@@ -28,6 +28,12 @@ if [[ -f /usr/local/bin/borg ]]; then
echo
"# HELP borg_hetzner_last_archive_timestamp timestamp of last backup in UTC"
>>
$TMP_FILE
echo
"# TYPE borg_hetzner_last_archive_timestamp counter"
>>
$TMP_FILE
echo
"borg_hetzner_last_archive_timestamp
$LAST_ARCHIVE_TIMESTAMP
"
>>
$TMP_FILE
;
REPO_SIZE
=
$(
/usr/local/bin/borg info
--json
| jq
'.cache.stats.unique_csize'
)
echo
"# HELP borg_hetzner_repo_size_bytes amount of data stored in the repo in bytes"
>>
$TMP_FILE
echo
"# TYPE borg_hetzner_repo_size_bytes gauge"
>>
$TMP_FILE
echo
"borg_hetzner_repo_size_bytes
$REPO_SIZE
"
>>
$TMP_FILE
fi
# rsync.net borg
...
...
@@ -40,6 +46,12 @@ if [[ -f /usr/local/bin/borg-offsite ]]; then
echo
"# HELP borg_offsite_last_archive_timestamp timestamp of last backup in UTC"
>>
$TMP_FILE
echo
"# TYPE borg_offsite_last_archive_timestamp counter"
>>
$TMP_FILE
echo
"borg_offsite_last_archive_timestamp
$LAST_ARCHIVE_TIMESTAMP
"
>>
$TMP_FILE
;
REPO_SIZE
=
$(
/usr/local/bin/borg-offsite info
--json
| jq
'.cache.stats.unique_csize'
)
echo
"# HELP borg_offsite_repo_size_bytes amount of data stored in the repo in bytes"
>>
$TMP_FILE
echo
"# TYPE borg_offsite_repo_size_bytes gauge"
>>
$TMP_FILE
echo
"borg_offsite_repo_size_bytes
$REPO_SIZE
"
>>
$TMP_FILE
fi
mv
-f
$TMP_FILE
$PROM_FILE
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment