resticprofile icon indicating copy to clipboard operation
resticprofile copied to clipboard

Add backup duration variable to send-after hook

Open MexHigh opened this issue 1 year ago • 0 comments

It would be super useful to have a variable that holds the time of how long the backup took in the senf-after and send-after-fail hooks. Maybe something like this with ${BACKUP_DURATION}?:

base:
  backup:
    send-after:
      method: POST
      url: https://example.com/message
      body: "title=Profile ${PROFILE_NAME} ${PROFILE_COMMAND} success&message=Backup took: ${BACKUP_DURATION}"
      headers:
        - name: "Content-Type"
          value: "application/x-www-form-urlencoded"
    send-after-fail:
      method: POST
      url: https://example.com/message
      body: "title=Profile ${PROFILE_NAME} ${PROFILE_COMMAND} failed&message=${ERROR}\n\n${ERROR_STDERR}\n\nTook: ${BACKUP_DURATION}"
      headers:
        - name: "Content-Type"
          value: "application/x-www-form-urlencoded"
...

MexHigh avatar Jun 22 '24 18:06 MexHigh