Repository navigation
Wishlist: Use command's exitcode for PASS/FAIL handling? #241
Description
Activity
- This sounds like a really helpful addition!…On Thu 8 Jan 2026 at 18:28, Peter B. ***@***.***> wrote: *pjotrek-b* created an issue (MediaArea/MediaConch#241) <#241> Hi everyone 😄 I've read the Documentation on How To Use MediaConch <https://mediaarea.net/MediaConch/Documentation/HowToUse>, and was wondering if it's possible to have MediaConch return a non-zero exit-code to let the caller (CLI) know if a policy file was PASS or FAIL? AFAI understood, the current way to do so is to parse the mconch-report output format (xml, json, etc), right? Curious on your opinions! — Reply to this email directly, view it on GitHub <#241>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAITFPUNBHMCAK24PYXDVKT4F2OVPAVCNFSM6AAAAACRDCYCNOVHI2DSMVQWIX3LMV43ASLTON2WKOZTG44TGOJTHAYTEOI> . You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
We imagined exit code for MediaConch for MediaConch itself, but true that it deserves to directly provide the PASS or FAIL.
Reacted by רטו\רעטאָ\רֵיטוֹ • Reto@JeromeMartinez : sure, the exitcodes shall (still) be for MediaConch itself!
I was thinking along something similar to
rsync(see below), where its documentation lists several different exit values for different "feeback" to the caller.So would it be possible to have something like this for MediaConch?
- 0 Success
- 1 Syntax or usage error
- ...
- 20 PASS
- 21 FAIL
Of course the numbers are arbitrary. Just an idea 😎
Example from rsync:
(see:
man rsync; almost at the very bottom)EXIT VALUES 0 Success 1 Syntax or usage error 2 Protocol incompatibility 3 Errors selecting input/output files, dirs 4 Requested action not supported: an attempt was made to manipu‐ late 64-bit files on a platform that cannot support them; or an option was specified that is supported by the client and not by the server. 5 Error starting client-server protocol 6 Daemon unable to append to log-file 10 Error in socket I/O 11 Error in file I/O 12 Error in rsync protocol data stream 13 Errors with program diagnostics 14 Error in IPC code 20 Received SIGUSR1 or SIGINT 21 Some error returned by waitpid() 22 Error allocating core memory buffers 23 Partial transfer due to error 24 Partial transfer due to vanished source files 25 The --max-delete limit stopped deletions 30 Timeout in data send/receive 35 Timeout waiting for daemon connectionI've had the case now where the user can configure to generate different mediaconch output files (JSON, txt) to go into preservation.
Thanks to mconch allowing multiple files at the same time, I now add:
--Output-simple=/tmp/mediaconch_failpass.txt
... which I then use in my code to know if it's FAIL or PASS. 🤓 🥳(Finally adding this as MediaConch and MediaInfo Tasks to CInbox for born-digital ingest right now 🍰 😁)
Jerômé, these are such great and invaluable tools! Thank you so much!
see: man rsync; almost at the very bottom
😂 It’s actually the position in a man where this type of information is supposed to be found.
Stricto sensu, there should be no difference between “success” and PASS, both should be the value
0, or am I missing something?Stricto sensu, there should be no difference between “success” and PASS, both should be the value 0, or am I missing something?
Right, 0 would be "Success AND pass".
Reacted by Peter B.So, what about:
0 = pass1 = failx = ... other non-success issue(syntax or usage or runtime errors, etc)
Then pass+fail would be next to each other 😄
Hi everyone 😄
I've read the Documentation on How To Use MediaConch, and was wondering if it's possible to have MediaConch return a non-zero exit-code to let the caller (CLI) know if a policy file was PASS or FAIL?
AFAI understood, the current way to do so is to parse the mconch-report output format (xml, json, etc), right?
Curious on your opinions!