diff --git a/borg_exporter.sh b/borg_exporter.sh index 3df3e28..2841a6f 100755 --- a/borg_exporter.sh +++ b/borg_exporter.sh @@ -17,7 +17,7 @@ COUNTER=0 [ -e $TEXTFILE_COLLECTOR_DIR ] || mkdir -p $TEXTFILE_COLLECTOR_DIR COUNTER=$(echo "$ARCHIVES" | wc -l) -LAST_ARCHIVE=$(BORG_PASSPHRASE=$BORG_PASSPHRASE borg list $REPOSITORY | sort -nr | head -n 1) +LAST_ARCHIVE=$(BORG_PASSPHRASE=$BORG_PASSPHRASE borg list --last 1 $REPOSITORY) LAST_ARCHIVE_NAME=$(echo $LAST_ARCHIVE | awk '{print $1}') LAST_ARCHIVE_DATE=$(echo $LAST_ARCHIVE | awk '{print $3" "$4}') LAST_ARCHIVE_TIMESTAMP=$(date -d "$LAST_ARCHIVE_DATE" +"%s")