From 4adca741ee528c7d000ae03876862df69e791cf2 Mon Sep 17 00:00:00 2001 From: lasimik Date: Fri, 21 May 2021 10:46:31 +0000 Subject: [PATCH] Update 'Readme.md' Fixed incorrect timezone in time calculations. --- Readme.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index 6dc6cdd..13781ab 100644 --- a/Readme.md +++ b/Readme.md @@ -68,7 +68,7 @@ sudo -u NAME DISPLAY=:0 \ --- ### Example for Overdue Backups Alerts -#### In the borgmatic config +#### In borgmatic config To know when the last complete backup was made, even if there is no connection to the repository, the date and time needs to be stored locally (here in a `last-successful-backup` file), after every successful backup (hook `after_backup:`). This example uses date and time of the last *complete* backup. Borgmatic does not supply this in a placeholder, so it is identified with `borgmatic list --successful --last 1`, returning only date and time (`--format {time}`) and without control characters (`--no-color `), then the header line is skipped (`sed -n 2p`), and the timezone (that the borgmatic return lacks) is appended (`date +'%:z'`). @@ -118,7 +118,8 @@ NOTIFYUSERID=UID # read date of last successful backup LASTBACKUP=$(<"/root/BackupUser@BackupServer:/path/to/repository/last-successful-backup") # get current datetime in a format for calculations and notification string -NOW="$(dateconv -f "%a, %F %T %Z" now)" +# (set LANG for compatibility with datediff's time format) +NOW="$(LANG=us_US date +'%a, %F %T %:z')" # time calculations: backup age... # ...in full hours for branching by age