New Feature: JSON backup report

Starting from version 1.2.0, there is an option Send report after completion on the Backup page, which will allow you to send a report to an http/https address after a backup is completed.

The default format for this report is:

  "computer": "mac-mini",
  "directory": "/Users/gchen/repository",
  "end_time": 1580837217,
  "new_chunk_size": 0,
  "new_chunks": 0,
  "new_file_chunk_size": 0,
  "new_file_chunks": 0,
  "new_file_size": 0,
  "new_files": 0,
  "new_metadata_chunk_size": 0,
  "new_metadata_chunks": 0,
  "result": "Error",
  "start_time": 1580837217,
  "storage": "",
  "storage_url": "/Users/gchen/storage",
  "total_chunk_size": 0,
  "total_chunks": 0,
  "total_file_chunk_size": 0,
  "total_file_chunks": 0,
  "total_file_size": 0,
  "total_files": 0,
  "total_metadata_chunk_size": 0,
  "total_metadata_chunks": 0,
  "upload_chunk_size": 0,
  "upload_file_chunk_size": 0,
  "upload_metadata_chunk_size": 0

These stats are extracted from the BACKUP_STATS logs in the backup log.

To customize the report format, create a file named report.tmpl under ~/.duplicacy-web, such as:

    "BackupResult": "{{.result}}",
    "BeginTime": {{.start_time}},
    "TotalFiles": {{.total_files}},
    "Storage": "{{.storage_url}}"

All tokens in the form of {{.<key>}} will be replaced be replaced by the corresponding value in the json file above. The final report based on that report.tmpl file will be:

    "BackupResult": "Error",
    "BeginTime": 1580837417,
    "TotalFiles": 0,
    "Storage": "/Users/gchen/storage"

Many thanks for adding this reporting feature as it means that I can push data into Paessler PRTG monitoring tool using the HTTP Push Data Advanced sensor to monitor the status of backups! :slightly_smiling_face:

The only issue I face is that it appears that the PRTG sensor is unable to import string based values such as the “.result” field.

Would there be a possbilty to extend the feature of Duplicacy to report numeric status values such as ‘0’ (Ok) and ‘1’ (Failed) as a further available field in the reporting template?

It would also be great if the reporting feature could be extended to the Duplicacy functions of “check” and “prunes”?

Many thanks!