Skip to content
Snippets Groups Projects
Verified Commit 0b2d8a8b authored by Evangelos Foutras's avatar Evangelos Foutras :smiley_cat:
Browse files

Monitor borg repo sizes

parent 90a51d33
No related branches found
No related tags found
No related merge requests found
Pipeline #8904 passed
......@@ -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;
ALL_ARCHIVES_SIZE=$(/usr/local/bin/borg info --json | jq '.cache.stats.unique_csize')
echo "# HELP borg_hetzner_all_archives_size_bytes amount of data stored in the repo in bytes" >> $TMP_FILE
echo "# TYPE borg_hetzner_all_archives_size_bytes gauge" >> $TMP_FILE
echo "borg_hetzner_all_archives_size_bytes $ALL_ARCHIVES_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;
ALL_ARCHIVES_SIZE=$(/usr/local/bin/borg-offsite info --json | jq '.cache.stats.unique_csize')
echo "# HELP borg_offsite_all_archives_size_bytes amount of data stored in the repo in bytes" >> $TMP_FILE
echo "# TYPE borg_offsite_all_archives_size_bytes gauge" >> $TMP_FILE
echo "borg_offsite_all_archives_size_bytes $ALL_ARCHIVES_SIZE" >> $TMP_FILE
fi
mv -f $TMP_FILE $PROM_FILE
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment