Você pode canalizar yes
para seu script:
yes | ambari-server upgrade
Isso fará com que todos os pedidos sejam respondidos com y
.
Quando eu executo o comando ambari-server upgrade
de um script bash, no meio da atualização nós recebemos a pergunta
have made a backup of the Ambari Server database [y/n] (y)?
assim, queremos automatizar o processo, esperando que o script envie yes
quando a pergunta chegar.
Por favor, informe como automatizar o ambari-server upgrade
por esperar
ambari-server upgrade
Using python /usr/bin/python
Upgrading ambari-server
INFO: Upgrade Ambari Server
INFO: Updating Ambari Server properties in ambari.properties
...
WARNING: Can not find ambari.properties.rpmsave file from
previous version, skipping import of settings
INFO: Updating Ambari Server properties in ambari-env.sh ...
INFO: Can not find ambari-env.sh.rpmsave file from previous
version, skipping restore of environment settings. ambari-env.sh may not
include any user customization.
INFO: Fixing database objects owner
Ambari Server configured for Embedded Postgres. Confirm you
have made a backup of the Ambari Server database [y/n] (y)?
INFO: Upgrading database schema
INFO: Return code from schema upgrade command, retcode = 0
INFO: Console output from schema upgrade command:
INFO: {"lzo_enabled":"false"}
INFO: Schema upgrade completedAdjusting ambari-server permissions and ownership...
Ambari Server 'upgrade' completed successfully.
Tags expect linux shell-script