Resume on error while executing multiple CLI commands via file

Solution Unverified - Updated -


  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x


When running a bunch of CLI commands via file it is desired to continue running all the cli commands even if some of the commands fails to execute.

commands.cli consists of below cli command


If second cli command fails, but I wish to resume with next command?


  • If execution of any CLI command fails it will be terminated and won't execute other CLI commands specified in the file. However there us a feature request raised [PRODMGT-1021] requesting resume on error feature in cli.

  • Currently users can break the CLI commands in multiple commands as following:

$JBOSS_HOME/bin/ --connect --controller=$JBOSS_IP:$Port --user=$USER --password=$PASSWORD --command="/subsystem=logging/"
$JBOSS_HOME/bin/ --connect --controller=$JBOSS_IP:$Port --user=$USER --password=$PASSWORD --command="/subsystem=logging/"
$JBOSS_HOME/bin/ --connect --controller=$JBOSS_IP:$Port --user=$USER --password=$PASSWORD --command="/subsystem=logging/logger=com.sample:remove()"

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.