My current backup flow leverages a wrapper script which executes the duplicacy backup commands and reports failures to my monitoring tool. However, I’ve noticed that duplicacy reports success (i.e. return code 0) even when it encounters permissions errors reading the repository files. I would expect it to return a non-zero error code in these cases so the failures can be picked up and addressed. Is there a way to make it return a non-zero code or must I monitor stderr or something?
Example:
$ duplicacy -v backup
Storage set to /home/ansible/duplicacy_perm_error_test/
Downloading latest revision for snapshot per-test
Listing revisions for snapshot per-test
Last backup at revision 4 found
Indexing /home/ansible/root_perm_test
Parsing filter file /home/ansible/root_perm_test/.duplicacy/filters
Loaded 0 include/exclude pattern(s)
Packing root_file.txt
Failed to open file for reading: open /home/ansible/root_perm_test/root_file.txt: permission denied
File root_file.txt cannot be opened
Listing snapshots/
Listing snapshots/per-test/
Listing chunks/
Listing chunks/fa/
Listing chunks/ba/
Listing chunks/60/
Listing chunks/3b/
Backup for /home/ansible/root_perm_test at revision 5 completed
1 file was not included due to access errors
$ echo $?
0