LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Is it possible to write script for this scenario?? (https://www.linuxquestions.org/questions/linux-server-73/is-it-possible-to-write-script-for-this-scenario-869699/)

anishkumarv 03-19-2011 10:22 PM

Is it possible to write script for this scenario??
 
Hi all,

We are hosting Webserver using Apache -tomcat , in our company we are following this way for our every new enhancement in production server.

for example if the developers move any new code moved to the server means that time we'll do

1.first check the time / date

2. mod_jk log which domain currently accessing our client,

3. and check the last 20 lines of the http_access log in http access log if the domain accessing from our side means that means we are using two static ip , in the http_access log in the last 20 lines our static ip(ex 122.65.77.88, 122.65.77.89) displayed means we then

4. stop the tomcat and killall the java process and again restart the tomcat process.

else

in the http_access log display any other ip means we check the time/date if the date/time is current date/time means we just hold the server restart for few mins otherwise we restart the server.

Note these all scenario happens while minor server push......

for this scenario is it possible to write the script ??? If possible means please guide me..

With Regards
Anish Kumar.V

EricTRA 03-20-2011 02:50 AM

Hello,

You can write a script for almost anything in Linux. Just take it one step at the time, one command after another, test every command to see if it gives you the required result on the command line and put everything in a script. Show us what you've got and where you're having trouble/errors and we'll take it from there.

Kind regards,

Eric

huaihaizi3 03-20-2011 08:35 AM

Its obviously that almost everything can be done with scrips in Linux, just write down what you want the system to do ~!


All times are GMT -5. The time now is 11:46 PM.