[英]How to run wsadmin scripts in single wrapper shell script
I have some wsadmin python scripts and i tried to include them in single script as below i need to execute all these scripts with the help of single wrapper script,but i have been facing errors while executing it.so can anyone kindly let me know whats wrong with my script here我有一些 wsadmin python 脚本,我尝试将它们包含在单个脚本中,如下所示我需要在单个包装脚本的帮助下执行所有这些脚本,但是我在执行它时遇到了错误。所以任何人都可以让我知道什么我的脚本在这里错了
#!/usr/bin/env python3
sh wsadmin.sh -lang jython -f /home/Devop/listApps.py
sh wsadmin.sh -lang jython -f /home/Devop/cluster.py
sh wsadmin.sh -lang jython -f /home/Devop/heap.py
sh wsadmin.sh -lang jython -f /home/Devop/Dslist.py
sh wsadmin.sh -lang jython -f /home/Devop/listservers.py
root@bin]# ./wsadmin.sh -lang jython -f /home/Devop/wrapper.py
WASX7209I: Connected to process "server1" on node localhostNode02 using SOAP connector; The type of process is: UnManagedProcess
WASX7017E: Exception received while running file "/home/Devop/wrapper.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
(no code object) at line 0
File "<string>", line 3
sh wsadmin.sh -lang jython -f /home/Devop/listApps.py
^
SyntaxError: invalid syntax
I am getting this syntax error我收到此语法错误
what you have now could be used if you rename /home/Devop/wrapper.py to /home/Devop/wrapper.sh with full path to wsadmin.sh inside and run from: root@bin]# /home/Devop/wrapper.sh如果您将 /home/Devop/wrapper.py 重命名为 /home/Devop/wrapper.sh 并在其中运行 wsadmin.sh 的完整路径并从以下位置运行,则可以使用您现在拥有的内容:root@bin]# /home/Devop/wrapper .sh
But I believe you are using python in a wrong way.但我相信您以错误的方式使用 python。 I would suggest you to define functions for each of your python file and include them in one base script to run.
我建议您为每个 python 文件定义函数,并将它们包含在一个要运行的基本脚本中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.