开发者

Shell script to startup, exit and run other scripts once it completes

开发者 https://www.devze.com 2023-03-08 11:10 出处:网络
I have been trying to automate this process in shell script in a unix box. I am ne开发者_JS百科w to shell scripts.

I have been trying to automate this process in shell script in a unix box. I am ne开发者_JS百科w to shell scripts. I have not been able to figure out how to detect when the startup for it has finished . Also, how to create a new terminal and check the domain.log for the new terminal. I would appreciate if anyone can help me on this .

cd $/home/oracle/12/bin 
./lsnrctl start

Login to sqlplus with username sys as sysdba and password: oracle3211 and run the database startup command startup

Once it is started type exit

--now start the dbconsole

cd $/home/oracle/12/bin 
./emctl start dbconsole

--open a new terminal and execute this

$/home/oracle/startWeblogic.sh

--wait for domain.log keyword in the log file to confirm the server has started --if the server is started proceed to the following in a new terminal

$/home/oracle/startManagedWeblogic.sh

--after this access the following urls

https://178:198:29:28:1167/em (username=system1, password=oracle123)
https://178:198:29:28:1176/em (username=system2, password=oracle132)


Sounds like you also need to learn about the GNU screen command. You may already have it installed. Try screen -R -D

If it gives you a shell prompt at the top of the screen then it works. Now if you disconnect your ssh session or close your terminal window (click on the X), the next time you log in and run the exact same screen command, you are reconnected to the same running terminal session.

This allows you to run scripts, etc. which do not stop when you disconnect. And when you reconnect you can see their current output.

Also, you can have many terminal sessions. Ctrl-A c creates another one. Ctrl-A [space] and Ctrl-A [backspace] rotate between sessions in the list. Ctrl-A ? gives you all the other Ctrl-A commands that you can use. For instance, one session could be tail logfile while another one is running a program waiting for input.

0

精彩评论

暂无评论...
验证码 换一张
取 消