Description of problem: engine-backup user experience need to be improved: [root@ovirt ~]# engine-backup FATAL: --mode=<backup|restore> is missing [root@ovirt ~]# engine-backup --mode=backup FATAL: --file is missing readlink: missing operand Try 'readlink --help' for more information. /usr/bin/engine-backup: line 1405: : No such file or directory Notifying engine /usr/bin/engine-backup: line 1472: : No such file or directory /usr/bin/engine-backup: line 1405: : No such file or directory FATAL: Failed notifying engine I would expect to have the output of --help if any of the required options is missing. Looking at engine-backup --help: /usr/bin/engine-backup [--mode=MODE] [--scope=SCOPE] [--file=FILE] [--log=FILE] looks like all the parameters are optional but all of them are required for engine-backup to work: [root@ovirt ~]# engine-backup FATAL: --mode=<backup|restore> is missing # engine-backup --mode=backup --scope=all FATAL: --file is missing readlink: missing operand Try 'readlink --help' for more information. /usr/bin/engine-backup: line 1405: : No such file or directory Notifying engine /usr/bin/engine-backup: line 1472: : No such file or directory /usr/bin/engine-backup: line 1405: : No such file or directory FATAL: Failed notifying engine [root@ovirt ~]# engine-backup --mode=backup --scope=all --file=backup FATAL: --log is missing readlink: missing operand Try 'readlink --help' for more information. /usr/bin/engine-backup: line 1405: : No such file or directory Notifying engine /usr/bin/engine-backup: line 1472: : No such file or directory /usr/bin/engine-backup: line 1405: : No such file or directory FATAL: Failed notifying engine [root@ovirt ~]# engine-backup --mode=backup --scope=all --file=backup --log=log Backing up: Notifying engine - Files - Engine database 'engine' Packing into file 'backup' Notifying engine Done.
Much of the noise is already fixed by bug 1296520. Not sure I agree with showing --help on errors. It's very long, and distracts from the actual error. Perhaps add 'Please see --help' or something. It might make sense to have more options, or even all of them, have defaults. Say, --file /var/lib/ovirt-engine/engine-backup/engine-backup-TIMESTAMP.RANDOM.bck (or maintain a list of file extension per --archive-compressor and use .tar.EXT instead of .bck) --log /var/log/ovirt-engine/engine-backup/engine-backup-TIMESTAMP.RANDOM.log --mode backup? not sure about that one. Most similar programs require passing such an option (either as an option (tar) or as part of the name (zip/unzip)). IIRC this was discussed in the past, not sure about the outcome. Also, this is the behavior since the first version (in 3.3), not sure what's urgent to include it in 3.6. If we do want to, consider also bug 1296520 (which is for 4.0 currently).
(In reply to Yedidyah Bar David from comment #1) > --mode backup? > not sure about that one. Most similar programs require passing such an > option (either as an option (tar) or as part of the name (zip/unzip)). We can also add a wrapper engine-restore that runs engine-backup --mode=restore. If we go that route (of requiring as few options as possible).
I'm fine with just telling to look at --help instead of printing it. Ok to re-target to 4.0 not being urgent. It make sense to use a default for --log making it optional. Everything else may stay as it is right now, just making clear in the --help what's not optional, changing /usr/bin/engine-backup [--mode=MODE] [--scope=SCOPE] [--file=FILE] [--log=FILE] to /usr/bin/engine-backup --mode=MODE --scope=SCOPE --file=FILE [--log=FILE] (see https://en.wikipedia.org/wiki/Usage_message#Examples on optional and required arguments)
*** Bug 1329383 has been marked as a duplicate of this bug. ***
*** Bug 1340419 has been marked as a duplicate of this bug. ***
Decided to just fix the usage text for now. As mentioned, most noise was already fixed by bug 1296520. While I would personally prefer to have defaults for most everything, I can anticipate endless arguments/bugs/reports for whatever choice we make (hard-coded directories, current directory, etc), so would ignore this for now.
The fix for this issue should be included in oVirt 4.1.0 beta 1 released on December 1st. If not included please move back to modified.
This wont be automated, basic sanity will be sufficient for verification process. $ engine-backup --help engine-backup: back up and restore ovirt-engine environment USAGE: /usr/bin/engine-backup --mode=MODE --scope=SCOPE --file=FILE --log=FILE [options] ...