Running Shell Commands
This action aims to run shell scripts on a host in a specified environment. The following table describes the configuration parameters.
Parameter |
Description |
---|---|
Action Name |
Custom action name. Enter 1 to 128 characters. Do not start or end with a space. Use letters, digits, spaces, and these special characters: -_,;:./() |
Environment |
Deployment object. Select an environment whose resource type is host cluster. |
Shell Commands |
Bash scripts to run. |
Action Control |
You can configure whether to enable the settings.
|
Example: Using Shell Commands to Check Service Logs
After application deployment is complete, you can run the shell commands to view the service startup or execution logs.
Preparations
- Ensure that you are an authorized user of a host. Only authorized users have the permissions required to view service startup or execution logs.
- Determine the full path of the service startup log.
The following describes how to install the Tomcat service:
Full path of the service startup log: /usr/local/tomcat/apache-tomcat-8.5.38/logs/catalina.out
Procedure
- Run the tail command to query the service startup or execution logs.
- Run the following command to query the last 20 lines of the log. The following figure shows the command output.
tail -n 20 /usr/local/tomcat/apache-tomcat-8.5.38/logs/catalina.out

Do not run the cat command when running the shell command to check files. If the log file is too large, it may take some time to load data. Do not use the tail –f command.
If the shell command to be executed contains more than 10,240 characters, you are advised to Run Shell Script extension.
If you encounter any problems during deployment, see Running Shell Commands.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot