0

I regularly login to PuTTY and run the following commands to complete a task.

1st Command :

cd/u01/app/oracle/user_projects/domains/COLLECT/EOD/bin_arm

2nd Command :

./FileUpload.sh

3rd Command :

cd/u01/app/oracle/user_projects/domains/COLLECT/EOD/bin_arm

4th Command :

./execute_eodarx.sh

How can I automate this with the help of batch or other scripting?

I need to run these commands synchronously. (The next command is to run after the completion of the previous command.)

robinCTS
  • 4,407

2 Answers2

1

You practically wrote the script already. If you put all four commands in a file on the server, then you can run it via sh myscript.sh and you have the batch script.

(If you also want it to be runnable as ./myscript.sh, first add the #!/bin/sh header at the top, then use chmod a+x myscript.sh to mark the file as executable.)

grawity
  • 501,077
0

If you are using any Windows OS , try using Multi Tabbed Puty

It has features like save and manage putty sessions and automatically run scripts whenever the sessions are started.

To run commands automatically after logging in ,

  • Right click on your Putty Session from Servers and select Properties
  • Click on Scripts tab in the newly opened dialog box
  • In the box provided, you can add the commands which will be run after login You can also specify the wait period too after which the commands will be executed.