Exit codes details


#1

All Duplicacy commands return 0 when successful, otherwise non-zero. The specific non-zero codes are:

  • 1: the command was interrupted by user
  • 2: the command arguments are malformed
  • 3: invalid value for a command argument
  • 100: the command encountered an error in the Duplicacy code (most run-time errors, including those from failed connections, will emit this exit code)
  • 101: the command encountered an error in a dependency library used by Duplicacy

Pre Command and Post Command Scripts
Email Alert/Cron Setup Questions
Exit code is 0 even though i typed an inexistent command
Central Monitoring?
CLI Error Codes?
Duplicacy User Guide
#2

I think, as it is implemented right now, the 0 exit code is a little misleading. I mean, I would like to get a 0 exit code when absolutely no problem occurred, not even a warning, so that I can send (by scripting) an email saying “backup successful”.

I just did a backup, a file was not backed up, but I still got a 0 exit code! What if it was an important file? What if 99% of files (for some reason) were not backed up? Should i always “grep” the backup output looking for signs of trouble? What if I grep for some specific text and in some future release the warning message changes? The exit codes exist to avoid this kind of problems, I think. So why not to add another exit code in case of any warning or problem during the backup?

Here is my backup output that gave me 0 exit code:

Backup for / at revision 3 completed
Files: 1278499 total, 573,580M bytes; 183 new, 70,170K bytes
File chunks: 116957 total, 573,807M bytes; 11 new, 62,841K bytes, 19,645K bytes uploaded
Metadata chunks: 92 total, 482,955K bytes; 16 new, 99,754K bytes, 28,975K bytes uploaded
All chunks: 117049 total, 574,278M bytes; 27 new, 162,596K bytes, 48,620K bytes uploaded
Total running time: 00:02:30
1 file was not included due to access errors


#3

I’ve just created an issue on GitHub.


split this topic #4

2 posts were merged into an existing topic: Move all Github issues to Discourse?