Add newline to the end of the file

This commit is contained in:
phil 2023-12-02 17:24:29 +01:00
parent 5009ed456e
commit dd9b8b717c

View file

@ -19,13 +19,13 @@ borg_backup_age=$(echo "$NOW" "$borg_last_modified" | awk '{print(($1 - $2) / (2
get_status_data() { get_status_data() {
cat <<EOF cat <<EOF
# HELP backup_age Age of last backup ind days. # HELP backup_age Age of last backup in days.
# TYPE backup_age gauge # TYPE backup_age gauge
backup_age $borg_backup_age backup_age $borg_backup_age
# HELP backup_files Number of files in backup. # HELP backup_files Number of files in backup.
# TYPE backup_files gauge # TYPE backup_files gauge
backup_files $(get_field 'archives | .[] | .stats.nfiles') backup_files $(get_field 'archives | .[] | .stats.nfiles')
# HELP backup_chunks_unique Number of unique chunks of recent backup. # HELP backup_chunks_unique Number of unique chunks of last backup.
# TYPE backup_chunks_unique gauge # TYPE backup_chunks_unique gauge
backup_chunks_unique $(get_field 'cache.stats.total_unique_chunks') backup_chunks_unique $(get_field 'cache.stats.total_unique_chunks')
# HELP backup_chunks_total Number of chunks in all backups. # HELP backup_chunks_total Number of chunks in all backups.
@ -56,3 +56,6 @@ status=$(get_status_data)
printf '%s' "$status" >"$TMP_FILE" printf '%s' "$status" >"$TMP_FILE"
mv "$TMP_FILE" "$PROM_FILE" mv "$TMP_FILE" "$PROM_FILE"
# The textfile collector needs a newline at the end of the file
echo >> "$PROM_FILE"