owncloud / ocis

:atom_symbol: ownCloud Infinite Scale Stack
https://doc.owncloud.com/ocis/next/
Apache License 2.0
1.25k stars 169 forks source link

`ocis backup consistency` `--fail` option #9411

Closed wkloucek closed 1 week ago

wkloucek commented 2 weeks ago

Is your feature request related to a problem? Please describe.

ocis backup consistency should have a ´--fail` option where exits with a non zero exit code if it finds inconsistencies.

Describe the solution you'd like

If the --fail flag is provided and inconsistencies are found, the exit could is != 0, eg 1.

Describe alternatives you've considered

Parse the log output for strings indicating that inconsistencies have been found but that is somehow error prone since those strings could change over time.

Additional context

Maybe this is similiar to the --fail option of curl (see https://curl.se/docs/manpage.html#-f)

cc @kobergj

kobergj commented 2 weeks ago

Should be fairly easy implementable. The curl manpage mentions it returns status code 22. Should we also return a special status code? Or we just go with generic 1?

wkloucek commented 2 weeks ago

Or we just go with generic 1?

1 would be fine for me