mirror of
https://github.com/offen/docker-volume-backup.git
synced 2024-11-14 10:30:27 +01:00
Frederik Ring
5c04e11f10
* Scaffold Azure storage backend that does nothing yet * Implement copy for Azure Blob Storage * Set up automated testing for Azure Storage * Implement pruning for Azure blob storage * Add documentation for Azure Blob Storage * Add support for remote path * Add azure to notifications doc * Tidy go.mod file * Allow use of managed identity credential * Use volume in tests * Auto append trailing slash to endpoint if needed, clarify docs, tidy mod file
2.7 KiB
2.7 KiB
Notification templates reference
In order to customize title and body of notifications you'll have to write a go template and mount it inside the /etc/dockervolumebackup/notifications.d/
directory.
Configuration, data about the backup run and helper functions will be passed to this template, this page documents them fully.
Data
Here is a list of all data passed to the template:
Config
: this object holds the configuration that has been passed to the script. The field names are the name of the recognized environment variables converted in PascalCase. (e.g.BACKUP_STOP_CONTAINER_LABEL
becomesBackupStopContainerLabel
)Error
: the error that made the backup fail. Only available in thetitle_failure
andbody_failure
templatesStats
: objects that holds stats regarding script execution. In case of an unsuccessful run, some information may not be available.StartTime
: time when the script started executionEndTime
: time when the backup has completed successfully (after pruning)TookTime
: amount of time it took for the backup to run. (equal toEndTime - StartTime
)LockedTime
: amount of time it took for the backup to acquire the exclusive lockLogOutput
: full log of the applicationContainers
: object containing stats about the docker containersAll
: total number of containersToStop
: number of containers matched by the stop ruleStopped
: number of containers successfully stoppedStopErrors
: number of containers that were unable to be stopped (equal toToStop - Stopped
)
BackupFile
: object containing information about the backup fileName
: name of the backup file (e.g.backup-2022-02-11T01-00-00.tar.gz
)FullPath
: full path of the backup file (e.g./archive/backup-2022-02-11T01-00-00.tar.gz
)Size
: size in bytes of the backup file
Storages
: object that holds stats about each storageLocal
,S3
,WebDAV
,Azure
orSSH
:Total
: total number of backup filesPruned
: number of backup files that were deleted due to pruning rulePruneErrors
: number of backup files that were unable to be pruned
Functions
Some formatting and helper functions are also available:
formatTime
: formats a time object using RFC3339 format (e.g.2022-02-11T01:00:00Z
)formatBytesBin
: formats an amount of bytes using powers of 1024 (e.g.7055258
bytes will be6.7 MiB
)formatBytesDec
: formats an amount of bytes using powers of 1000 (e.g.7055258
bytes will be7.1 MB
)env
: returns the value of the environment variable of the given key if set