Use complete timestamp for last backup, output in epoch
This commit is contained in:
parent
47fb292ff0
commit
8404625755
1 changed files with 1 additions and 1 deletions
|
@ -10,7 +10,7 @@ TMP_FILE=$PROM_FILE.$$
|
|||
HOSTNAME=$(hostname)
|
||||
|
||||
BORG_INFO=$(borgmatic --no-color info --last 1 ) || mv $TMP_FILE $PROM_FILE
|
||||
echo "backup_last_run{host=\"${HOSTNAME}\"} $(echo "$BORG_INFO" | grep "Time (start)" | awk '{print $4}')" >> $TMP_FILE
|
||||
echo "backup_last_run{host=\"${HOSTNAME}\"} $(echo "$BORG_INFO" | grep "Time (start)" | awk '{print $4, $5}' | xargs -i date -d "{}" +"%s")" >> $TMP_FILE
|
||||
echo "backup_files{host=\"${HOSTNAME}\"} $(echo "$BORG_INFO" | grep "Number of files" | awk '{print $4}')" >> $TMP_FILE
|
||||
echo "backup_chunks_unique{host=\"${HOSTNAME}\"} $(echo "$BORG_INFO" | grep "Chunk index" | awk '{print $3}')" >> $TMP_FILE
|
||||
echo "backup_chunks_total{host=\"${HOSTNAME}\"} $(echo "$BORG_INFO" | grep "Chunk index" | awk '{print $4}')" >> $TMP_FILE
|
||||
|
|
Loading…
Reference in a new issue