We help IT Professionals succeed at work.

Logs redirecting on one server only

Sumit Prakash
on
239 Views
Last Modified: 2017-06-09
Hello Team,

I have made a password connectivity between two servers.

Now My script will do like it will execute one query and redirect the output on locaton /data/Sumit .


It will now connect to another server through passwordless conenctivity , and will execute one command but i want the output of that query will go to originial main server in same path /data/Sumit.

Please let me us as I am new to shell script.
Comment
Watch Question

MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
This can be done using /usr/bin/ssh-keygen
Here goes related steps:
In localhost
$ /bin/mkdir ~/.ssh
$ /bin/chmod 700 ~/.ssh
$ /usr/bin/ssh-keygen -d ~/.ssh/id_rsa -N ""

Open in new window

I have used /usr/bin/ssh-keygen -d ~/.ssh/id_rsa -N ""
where -N "" means providing empty string as password.
After that execute the following in localhost:
$ /usr/bin/touch ~/.ssh/authorized_keys ~/.ssh/authorized_keys2
$ /bin/cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ /bin/cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys2
$ /bin/chmod 600 ~/.ssh/authorized_keys
$ /bin/chmod 600 ~/.ssh/authorized_keys2

Open in new window

MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
After completing above in localhost(Assume localhost hostname is LocalSystem):
Logon to User@RemoteHost
At RemoteHost
/bin/mkdir ~/.ssh
/bin/chmod 700 ~/.ssh

Open in new window

From LocalSystem sftp ~/.ssh/authorized_keys to User@RemoteHost:~/.ssh/authorized_keys
From LocalSystem sftp ~/.ssh/authorized_keys2 to User@RemoteHost:~/.ssh/authorized_keys2
At User@RemoteHost execute the following:
/bin/chmod 600 ~/.ssh/authorized_keys ~/.ssh/authorized_keys2

Open in new window

After this from LocalSystem you can
/usr/bin/ssh User@RemoteHost
without asking password.
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
Here goes the script to create authorized_keys at localhost:
#!/bin/bash
#Script to create following files in localhost:
#~/.ssh/id_rsa
#~/.ssh/id_rsa.pub
#~/.ssh/authorized_keys
#~/.ssh/authorized_keys2
if test ! -d ~/.ssh
then
	/bin/mkdir ~/.ssh
fi
SSH_Cur_Permission=''`/usr/bin/stat ~/.ssh | /bin/egrep "Access:" | /usr/bin/head -1 | /bin/awk '{ printf( "%s\n", substr( $2, 2,4)); }'`''
if test "700" != "$SSH_Cur_Permission"
then
	/bin/chmod 700 ~/.ssh
fi
if test ! -f ~/.ssh/id_rsa
then
	/usr/bin/ssh-keygen -N "" -f ~/.ssh/id_rsa
fi
if test ! -f ~/.ssh/authorized_keys
then
	/usr/bin/touch ~/.ssh/authorized_keys
fi
if test ! -f ~/.ssh/authorized_keys2
then
	/usr/bin/touch ~/.ssh/authorized_keys2
fi
AUTH_KEYS_Cur_Permission=''`/usr/bin/stat ~/.ssh/authorized_keys | /bin/egrep "Access:" | /usr/bin/head -1 | /bin/awk '{ printf( "%s\n", substr( $2, 2,4)); }'`''
if test "600" != "$AUTH_KEYS_Cur_Permission"
then
	/bin/chmod 600 ~/.ssh/authorized_keys
fi
AUTH_KEYS2_Cur_Permission=''`/usr/bin/stat ~/.ssh/authorized_keys2 | /bin/egrep "Access:" | /usr/bin/head -1 | /bin/awk '{ printf( "%s\n", substr( $2, 2,4)); }'`''
if test "600" != "$AUTH_KEYS_Cur_Permission2"
then
	/bin/chmod 600 ~/.ssh/authorized_keys2
fi
/bin/grep ''`/bin/awk '{ print $2}' ~/.ssh/id_rsa.pub`'' ~/.ssh/authorized_keys >/dev/null 2>&1
Ret=$?
if test 0 -ne $Ret
then
	/bin/cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys
fi
/bin/grep ''`/bin/awk '{ print $2}' ~/.ssh/id_rsa.pub`'' ~/.ssh/authorized_keys2 >/dev/null 2>&1
Ret=$?
if test 0 -ne $Ret
then
	/bin/cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys2
fi
echo "Following files are present in localhost:"
/bin/ls -latrd ~/.ssh/*

Open in new window

MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
Here no ssh running in current system. However I have posted related steps to follow to login to remote system without password.
Need to know if any more input required for the author?

Author

Commented:
Hello Sir,
Passwordless connectivity is done. Thanks for help.
I want to redirect output of my logs to only one server from where we have done ssh to another server
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
Here I do not have any system for checking ssh
After handling authorized_keys at User@RemoteHost
Sample using ssh from localSystem
/usr/bin/ssh User@RemoteHost <<EOL
FirstCommand
NextCommand
LastCommand
EOL

Open in new window

However EOL cannot be redirected to output file at localSystem
Hence you need to use command like:
$ OUTPUT_FILE="Output_"''`/bin/date "+%d_%b_%Y_%H_%M_%S_%N"`''
$ /usr/bin/ssh User@RemoteHost "RequiredCommand1;RequiredCommand2;exit" >"$OUTPUT_FILE" 2>&1
$ echo You will get output and error in $OUTPUT_FILE

Open in new window


Here testing above script not done.
Since no system here for testing.
You test that and inform if any error happens or not?
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
@Sumit Prakash
Here goes updated source code I have tested in personal system on sunday:
/bin/cat Create_Authorize_Keys.sh
#!/bin/bash
echo -ne "\033\0133\0110\0033\0133\0112"
echo "$ $0"
if test 0 -eq $#
then
        echo "Usage:"
        echo "$0 User@REQUIREDHOST"
        echo "OR"
        SAMPLE_USER=''`/usr/bin/getent passwd | /bin/awk -F: '{ print $1}' | /usr/bin/head -1`''
        echo "$0 $SAMPLE_USER@localhost"
        echo "OR"
        echo "$0 SAMPLE_USER@$HOSTNAME"
else
        export USERNAME=''`echo "$1" | /bin/sed "s/@.*//;"`''
        export RELATED_HOSTNAME=''`echo "$1" | /bin/sed "s/.*@//;"`''
        OS=''`/bin/uname -s | /bin/sed "s/\-.*//;"`''
        PING=''`/usr/bin/which ping`''
        SCP=''`/usr/bin/which scp`''
        if test "" != "$PING" && test "" != "$SCP"
        then
                echo "Validating $PING $RELATED_HOSTNAME"
                if test "CYGWIN_NT" = "$OS"
                then
                        $PING -n 3 "$RELATED_HOSTNAME" >/dev/null 2>&1
                else
                        $PING -c 3 "$RELATED_HOSTNAME" >/dev/null 2>&1
                fi
                Ret=$?
                if test 0 -ne $Ret
                then
                        echo "$PING $RELATED_HOSTNAME FAILED"
                        $PING "$RELATED_HOSTNAME"
                else
                        echo "$PING $RELATED_HOSTNAME PASS"
                        LOGNAME=''`/usr/bin/whoami`''
                        HOME=''`/usr/bin/getent passwd $LOGNAME | /bin/awk -F: '{ print $6}'`''
                        if test ! -d "$HOME"
                        then
                        	echo "$HOME No such directory for user \"$LOGNAME\""
                        else
				echo "Verifying existence of directory $HOME/.ssh at localhost for current user $LOGNAME"
				if test ! -d "$HOME/.ssh"
				then
					echo /bin/mkdir "$HOME/.ssh"
					/bin/mkdir "$HOME/.ssh"
				fi
				echo "Verified  existence of directory $HOME/.ssh at localhost for current user $LOGNAME"
				SSH_PERMISSION=''`/usr/bin/stat "$HOME/.ssh" |\
				/bin/egrep Access |\
				/bin/egrep Uid |\
				/bin/awk '{ printf( "%s", substr( $2, 2, 4));}'`''
				if test 4700 -ne $SSH_PERMISSION
				then
					echo "Changing permission 4700 for $HOME/.ssh directory at localhost"
					echo /bin/chmod 4700 $HOME/.ssh
					/bin/chmod 4700 $HOME/.ssh
				fi
				if test ! -f ~/.ssh/id_rsa ||\
				test ! -f ~/.ssh/id_rsa.pub
				then
					echo "Creating private and public keys for $LOGNAME@localhost"
					echo "/usr/bin/ssh-keygen -N \"\" -f ~/.ssh/id_rsa"
					/usr/bin/ssh-keygen -N "" -f ~/.ssh/id_rsa
				fi
				if test ! -f ~/.ssh/authorized_keys
				then
					echo /bin/cp -ip ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
					/bin/cp -ip ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
					echo /bin/chmod 4600 $HOME/.ssh/authorized_keys
					/bin/chmod 4600 $HOME/.ssh/authorized_keys
				fi
				if test ! -f ~/.ssh/authorized_keys2
				then
					echo /bin/cp -ip ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys2
					/bin/cp -ip ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys2
					echo /bin/chmod 4600 $HOME/.ssh/authorized_keys2
					/bin/chmod 4600 $HOME/.ssh/authorized_keys2
				fi
				AUTHORIZED_PERMISSION=''`/usr/bin/stat "$HOME/.ssh/authorized_keys" |\
				/bin/egrep Access |\
				/bin/egrep Uid |\
				/bin/awk '{ printf( "%s", substr( $2, 2, 4));}'`''
				echo "Verifying permission 4600 for $HOME/.ssh/authorized_keys file for current user $LOGNAME"
				if test 4600 -ne $AUTHORIZED_PERMISSION
				then
					echo "Changing permission 4600 for $HOME/.ssh/authorized_keys file"
					echo /bin/chmod 4600 $HOME/.ssh/authorized_keys
					/bin/chmod 4600 $HOME/.ssh/authorized_keys
				fi
				echo "Verified  permission 4600 for $HOME/.ssh/authorized_keys  file for current user $LOGNAME"
				echo "Verifying permission 4600 for $HOME/.ssh/authorized_keys2 file for current user $LOGNAME"
				AUTHORIZED_PERMISSION=''`/usr/bin/stat "$HOME/.ssh/authorized_keys2" |\
				/bin/egrep Access |\
				/bin/egrep Uid |\
				/bin/awk '{ printf( "%s", substr( $2, 2, 4));}'`''
				if test 4600 -ne $AUTHORIZED_PERMISSION
				then
					echo "Changing required permission for $HOME/.ssh/authorized_keys2 file"
					echo /bin/chmod 4600 $HOME/.ssh/authorized_keys2
					/bin/chmod 4600 $HOME/.ssh/authorized_keys2
				fi
				echo "Verified  permission 4600 for $HOME/.ssh/authorized_keys2  file for current user $LOGNAME"
				SSH_RET=$?
				if test "localhost" != "$RELATED_HOSTNAME" \
				&& test "127.0.0.1" != "$RELATED_HOSTNAME"
				then
					SFTP=''`/usr/bin/which sftp`''
					if test "" = "$SFTP"
					then
						echo "sftp No such file."
					else
						echo "Verifying or creating directory ~/.ssh at REQUIRED HOST $USERNAME@$RELATED_HOSTNAME "
						/usr/bin/ssh $USERNAME@$RELATED_HOSTNAME "if test ! -d .ssh;
						then
							/bin/mkdir .ssh;
						fi;"
						SSH_RET=$?
						if test 0 -ne $SSH_RET
						then
							echo "Closing this script since /usr/bin/ssh FAILED"
						else
							echo "Using sftp $USERNAME@$RELATED_HOSTNAME to upload authorized_keys to ~/.ssh directory at $RELATED_HOSTNAME."
							"$SFTP" $USERNAME@$RELATED_HOSTNAME <<EOL
lcd ~/.ssh
cd .ssh
put id_rsa.pub authorized_keys
put id_rsa.pub authorized_keys2
EOL
						fi
					fi
				fi
				if test 0 -eq $SSH_RET
				then
					echo "Verifying ~/.ssh directory and files permission at REQUIRED HOST $USERNAME@$RELATED_HOSTNAME"
					echo "          using /usr/bin/ssh"
					/usr/bin/ssh "$RELATED_HOSTNAME" "SSH_PERMISSION=''\`/usr/bin/stat \"\$HOME/.ssh\" |\
					/bin/egrep \"Access\" |\
					/bin/egrep Uid |\
					/bin/awk '{ printf( \"%s\", substr( \$2, 2, 4));}'\`'';
					echo \"Validating 4700 permission for \$HOME/.ssh at REQUIRED HOST $RELATED_HOSTNAME \";
					if test 4700 -ne \$SSH_PERMISSION;
					then
						echo \"Changing required permission for \$HOME/.ssh at REQUIRED HOST\";
						echo /bin/chmod 4700 \$HOME/.ssh;
						/bin/chmod 4700 \$HOME/.ssh;
					fi
					echo \"Validated  permission 4700 at REQUIRED HOST $RELATED_HOSTNAME for \$HOME/.ssh\";
					AUTHORIZED_PERMISSION=''\`/usr/bin/stat \"\$HOME/.ssh/authorized_keys\" |\
					/bin/egrep \"Access\" |\
					/bin/egrep Uid |\
					/bin/awk '{ printf( \"%s\", substr( \$2, 2, 4));}'\`'';
					echo \"Validating permission 4600 at REQUIRED HOST $RELATED_HOSTNAME for \$HOME/.ssh/authorized_keys\";
					if test 4600 -ne \$AUTHORIZED_PERMISSION;
					then
						echo \"Changing required permission at REQUIRED HOST \$HOME/.ssh/authorized_keys file\";
						echo /bin/chmod 4600 \$HOME/.ssh/authorized_keys;
						/bin/chmod 4600 \$HOME/.ssh/authorized_keys;
					fi
					echo \"Validated  permission 4600 at $RELATED_HOSTNAME for \$HOME/.ssh/authorized_keys\";
					AUTHORIZED_PERMISSION=''\`/usr/bin/stat \"\$HOME/.ssh/authorized_keys2\" |\
					/bin/egrep \"Access\" |\
					/bin/egrep Uid |\
					/bin/awk '{ printf( \"%s\", substr( \$2, 2, 4));}'\`'';
					echo \"Validating permission 4600 at $RELATED_HOSTNAME \$HOME/.ssh/authorized_keys2\";
					if test 4600 -ne \$AUTHORIZED_PERMISSION;
					then
						echo \"Changing required at REQUIRED HOST permission for \$HOME/.ssh/authorized_keys2 file\";
						echo /bin/chmod 4600 \$HOME/.ssh/authorized_keys2;
						/bin/chmod 4600 \$HOME/.ssh/authorized_keys2;
					fi;
					echo \"Validated  permission 4600 at $RELATED_HOSTNAME \$HOME/.ssh/authorized_keys2\";"
					SSH_RET=$?
				fi
			fi
		fi
        else
                if test "" = "$PING"
                then
                        echo "Unable to find ping in localhost"
                fi
                if test "" = "$SCP"
                then
                        echo "Unable to find scp in localhost"
                fi
        fi
fii

Open in new window

This script Create_Authorize_Keys.sh needs to be executed only once.
It can be executed like following example:
for EachSystem in User1@System1 User2@System1 User3@System2
do
           ./Create_Authorize_Keys.sh $EachSystem
done

Open in new window

After executing above loop, you can use /usr/bin/ssh to required system like:
Following code is sample code:
/usr/bin/ssh  UserName@RequireHOSTNAME "echo Output at \$HOSTNAME;if test -f ~/.ssh/authorized_keys;then /bin/ls -ld ~/.ssh/authorized_keys;fi"

Open in new window

Author

Commented:
Hi,

I am just made a simple script ,It is asking for below prompt:-

bash-3.2$ ./Prakash.sh
The authenticity of host 'eocecmpeuat1.kpno.be (10.110.16.12)' can't be established.
RSA key fingerprint is 21:7c:d5:25:04:f9:03:ea:f7:b1:d9:34:11:a3:4b:18.
Are you sure you want to continue connecting (yes/no)? yes

Author

Commented:
Hello Murugesan,

I have made the ssh connectivity properly. But now I have made one script which needs password to run ( ./runActivate command needs password 'feb2015' ) which i have to give it manually.
Can you please check below script and help .

#!/bin/bash

OUTPUT_FILE="Output_"''`/bin/date "+%d_%b_%Y_%H_%M"`''

/data/Conceptwave_5.2.4.6/designer/env/runActivate.sh OMSEPC@eocecmdbuat2.kpno.be:1511:OMSEPCUAT2 /data/CWMetadata/Metadata/cwf.war node2 active >"$OUTPUT_FILE" 2>&1

/usr/bin/ssh omsuat1@eocecmuiuat1.kpno.be "/data/Conceptwave_5.2.4.6/designer/env/runActivate.sh OMSEPC@eocecmdbuat2.kpno.be:1511:OMSEPCUAT2 /data/CWMetadata/Metadata/cwf.war node1 active
;exit" >>"$OUTPUT_FILE" 2>&1

echo You will get output and error in $OUTPUT_FILE
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
I do not have any Linux oriented host and sshd at office.
I will check tomorrow (13/May/2015 IST) using personal system.
Also can you post the code for /data/Conceptwave_5.2.4.6/designer/env/runActivate.sh and ./Prakash.sh

Author

Commented:
HI Mururgesan,

Please find the below script :-   //data/Sumit/Development.sh
.
#!/bin/bash

OUTPUT_FILE="Output_"''`/bin/date "+%d_%b_%Y_%H_%M"`''

/data/Conceptwave_5.2.4.6/designer/env/runActivate.sh OMSEPC@eocecmdbuat2.kpno.be:1511:OMSEPCUAT2 /data/CWMetadata/Metadata/cwf.war node2 active >"$OUTPUT_FILE" 2>&1

/usr/bin/ssh omsuat1@eocecmuiuat1.kpno.be "/data/Conceptwave_5.2.4.6/designer/env/runActivate.sh OMSEPC@eocecmdbuat2.kpno.be:1511:OMSEPCUAT2 /data/CWMetadata/Metadata/cwf.war node1 active
;exit" >>"$OUTPUT_FILE" 2>&1

echo You will get output and error in $OUTPUT_FILE

I am getting the below Error:-

-bash-3.2$ ./Deployment.sh
You will get output and error in Output_12_May_2017
-bash-3.2$ more Output_12_May_2017
INFO  - Starting ConceptWave Design Studio - 5.2.4.6 (b1336) 02/26/2014 02:26 PM (-help for options)
ERROR - Log directory /data/Sumit/log does not exist. Creating directory (file logging not active until restart)
INFO  - activate mode
ERROR - No valid license file(s) found in /data/Sumit
ERROR - An error has occurred. Log may contain additional details.
INFO  - Starting ConceptWave Design Studio - 5.2.4.6 (b1336) 02/26/2014 02:26 PM (-help for options)
ERROR - Log directory /export/home/omsuat1/log does not exist. Creating directory (file logging not active until restart)
INFO  - activate mode
ERROR - No valid license file(s) found in /export/home/omsuat1
ERROR - An error has occurred. Log may contain additional details.
bash: -c: line 1: syntax error near unexpected token `;'
bash: -c: line 1: `;exit'



Here is the script :-

more /data/Conceptwave_5.2.4.6/designer/env/runActivate.sh


#!/bin/sh
if [ $# -lt 4 ]
then
echo "Syntax:  "
echo "./runActivate.sh JDBC_URL war_file colon-separated-nodeids active/inactive disable_quick_activation"
echo "JDBC_URL could be user@host:port:sid,user@host:port/service_name or any jdbc url"
echo "Example: " 
echo "./runActivate.sh cw@localhost:1521:orcl /home/cwf.war nodeid1:nodeid2 active"
echo "./runActivate.sh cw@localhost:1521:orcl /home/cwf.war nodeid1:nodeid2 active true"
echo "./runActivate.sh \"cw@oracle.jdbc.driver.OracleDriver;jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)))\" /home/cwf.war nodeid1 active"
echo "(refer to documentation for details.)"
exit 1
fi
JDBC_URL=$1
WAR_LOCATION=$2
NODE_ID=$3
ACTIVE_FLAG=$4
QUICK_FLAG=$5
"/usr/jdk/instances/jdk1.7.0/bin/java" -Xms1024m -Xmx1024m -XX:MaxPermSize=128m -Djava.awt.headless=true -cp "/data/Conceptwave_5.2.4.6/designer/Designer.jar:/data/Conceptwave_5.2.4.6/lib/oracle/ojdbc6.jar:/data/Conceptwave_5.2.4.6/lib/oracle/orai18n.jar:/data/Conceptwave_5.2.4.6/lib/oracle/orai18n-mapping.jar:/data/Conceptwave_5.2.4.6/lib/ilog/sdworkflowmodeler.deployed.jar:/data/Conceptwave_5.2.4.6/lib/jdic/JDICplus.jar:/data/Conceptwave_5.2.4.6/lib/axis2/addressing-1.41.mar:/data/Conceptwave_5.2.4.6/lib/axis2/rampart-1.5.mar:/data/Conceptwave_5.2.4.6/lib/axis2/mex-1.4.1.mar:/data/Conceptwave_5.2.4.6/lib/axis2/wstx-asl-3.2.4.jar:/data/Conceptwave_5.2.4.6/lib/axis2/rampart-core-1.5.jar:/data/Conceptwave_5.2.4.6/lib/axis2/rampart-policy-1.5.jar" -Dcom.sun.management.jmxremote.port=10009 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false com.conceptwave.servicedesigner.ServiceDesigner -activate -jdbc="$JDBC_URL" $WAR_LOCATION $NODE_ID $ACTIVE_FLAG $QUICK_FLAG

Author

Commented:
Now I am getting below error:-

-bash-3.2$ ./Deployment.sh
You will get output and error in Output_12_May_2017
-bash-3.2$ more Output_12_May_2017
INFO  - Starting ConceptWave Design Studio - 5.2.4.6 (b1336) 02/26/2014 02:26 PM (-help for options)
INFO  - Log files saved in /data/Conceptwave_5.2.4.6/designer/env/log
INFO  - activate mode
INFO  - Signed license file license.lic
ERROR - Password must be specified if the console has been redirected or running inside eclipse.
INFO  - Starting ConceptWave Design Studio - 5.2.4.6 (b1336) 02/26/2014 02:26 PM (-help for options)
INFO  - Log files saved in /export/home/omsuat1/log
INFO  - activate mode
ERROR - No valid license file(s) found in /export/home/omsuat1
ERROR - An error has occurred. Log may contain additional details.
bash: -c: line 1: syntax error near unexpected token `;'
bash: -c: line 1: `;exit'
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
Our request not to post all errors at a time.
Provide the output of following command:
/data/Conceptwave_5.2.4.6/designer/env/runActivate.sh OMSEPC@eocecmdbuat2.kpno.be:1511:OMSEPCUAT2 /data/CWMetadata/Metadata/cwf.war node2 active

Open in new window

MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
a)
I cannot test the same script here
Replace:
/usr/bin/ssh omsuat1@eocecmuiuat1.kpno.be "/data/Conceptwave_5.2.4.6/designer/env/runActivate.sh OMSEPC@eocecmdbuat2.kpno.be:1511:OMSEPCUAT2 /data/CWMetadata/Metadata/cwf.war node1 active
;exit" >>"$OUTPUT_FILE" 2>&1

Open in new window

With:
Write the following in one line:
/usr/bin/ssh omsuat1@eocecmuiuat1.kpno.be "/data/Conceptwave_5.2.4.6/designer/env/runActivate.sh OMSEPC@eocecmdbuat2.kpno.be:1511:OMSEPCUAT2 /data/CWMetadata/Metadata/cwf.war node1 active;exit" >>"$OUTPUT_FILE" 2>&1

Open in new window

b)
Also let us know the output of following command at omsuat1@eocecmuiuat1.kpno.be
/data/Conceptwave_5.2.4.6/designer/env/runActivate.sh OMSEPC@eocecmdbuat2.kpno.be:1511:OMSEPCUAT2 /data/CWMetadata/Metadata/cwf.war node1 active

Open in new window

Author

Commented:
HI,

HEre is the output which we get :-

10:07:23.427 [main] INFO  c.c.s.ServiceDesigner - Starting ConceptWave Design Studio - 5.2.4.6 (b1336) 02/26/2014 02:26 PM (-help for options)
10:07:23.475 [main] INFO  c.c.s.ServiceDesigner - Log files saved in /data/Conceptwave_5.2.4.6/designer/env/log
10:07:23.497 [main] INFO  c.c.s.c.CommandLineMode - runconfig mode
10:07:23.511 [main] INFO  com.conceptwave - Signed license file license.lic
10:07:33.823 [main] INFO  c.conceptwave.cui.avm.Avm - Starting in runconfig mode
10:07:33.824 [main] INFO  c.conceptwave.cui.avm.Avm - Loading metadata from /data/CWMetadata/Metadata/cwf.war/
10:07:45.063 [main] WARN  c.c.yaml.XmlConverter - Skipping unknown child tag allowExtensions in cwt_do.dataOrder.sites.site
10:07:48.446 [main] INFO  c.conceptwave.cui.avm.Avm - Loading configuration for node CLUSTER
10:07:48.447 [main] INFO  c.conceptwave.cui.avm.Avm - Loading configuration id=CLUSTER database=[user=OMSEPC driver=OMSEPCUAT1@10.110.16.15 (10.110.16.15;1511;OMSEPCUAT1 [Oracle thin])]
10:07:49.340 [main] INFO  c.c.s.j2ee.JettyManager - Starting web server on port 7005 in CONFIG mode
10:07:49.631 [main] INFO  c.c.s.j2ee.JettyManager - Started web server on port 7005 in CONFIG mode
10:07:49.632 [main] INFO  c.conceptwave.cui.avm.Avm - Started configuration mode at "http://localhost:7005/cwf/config"
10:50:11.895 [Thread-5] INFO  c.c.s.ShutdownThread - Stopped ConceptWave Design Studio
14:18:57.345 [main] INFO  c.c.s.ServiceDesigner - Starting ConceptWave Design Studio - 5.2.4.6 (b1336) 02/26/2014 02:26 PM (-help for options)
14:18:57.392 [main] INFO  c.c.s.ServiceDesigner - Log files saved in /data/Conceptwave_5.2.4.6/designer/env/log
14:18:57.415 [main] INFO  c.c.s.c.CommandLineMode - activate mode
14:18:57.429 [main] INFO  com.conceptwave - Signed license file license.lic
14:19:45.832 [main] INFO  c.c.r.CwfSystem - total metadata compilation: 14
14:19:45.833 [main] INFO  c.c.r.CwfSystem -  > total process compilation: 1
14:19:45.833 [main] INFO  c.c.r.CwfSystem -   >> total process activity compilation: 0
14:19:46.895 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsPeAvmView" not found in the user profile system
14:19:46.895 [main] WARN  com.conceptwave.data - DW0103: Privilege "epcDataMigration" not found in the user profile system
14:19:46.895 [main] WARN  com.conceptwave.data - DW0103: Privilege "epcConfig" not found in the user profile system
14:19:46.895 [main] WARN  com.conceptwave.data - DW0103: Privilege "epcImport" not found in the user profile system
14:19:46.896 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsPayHandler" not found in the user profile system
14:19:46.896 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsaddressValid" not found in the user profile system
14:19:46.896 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsOrdManagPriv" not found in the user profile system
14:19:46.896 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsManageOrders" not found in the user profile system
14:19:46.896 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsSimPckDtlIss4" not found in the user profile system
14:19:46.896 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsSimPckDtlIss5" not found in the user profile system
14:19:46.897 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsProcActivity" not found in the user profile system
14:19:46.897 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsDashboard" not found in the user profile system
14:19:46.897 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsProviders" not found in the user profile system
14:19:46.897 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsIntAdmin" not found in the user profile system
14:19:46.897 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsUserProfile" not found in the user profile system
14:19:46.897 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsAdmin" not found in the user profile system
14:19:46.898 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsTaskWorker" not found in the user profile system
14:19:46.898 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsOnlyOrders" not found in the user profile system
14:19:46.898 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsAppAdminPriv" not found in the user profile system
14:19:46.898 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsDuplAccount" not found in the user profile system
14:19:46.898 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsCreditCheck" not found in the user profile system
14:19:46.898 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsDocMandate" not found in the user profile system
14:19:46.899 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsTaskContext" not found in the user profile system
14:19:46.899 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsSIMDispatch" not found in the user profile system
14:19:46.899 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsSIMDetailPriv" not found in the user profile system
14:19:46.899 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsConfiguration" not found in the user profile system
14:19:46.899 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsAppPriv" not found in the user profile system
14:19:46.899 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsOrdValidPriv" not found in the user profile system
14:19:46.899 [main] WARN  com.conceptwave.data - DW0103: Privilege "cwt_omSupport" not found in the user profile system
14:19:46.900 [main] WARN  com.conceptwave.data - DW0103: Privilege "cwtCUAddrAdmin" not found in the user profile system
14:19:46.900 [main] WARN  com.conceptwave.data - DW0103: Privilege "cwtCUPartyAdmin" not found in the user profile system
14:19:46.900 [main] WARN  com.conceptwave.data - DW0524: There is no default system calendar. Run time processes will fail
14:19:47.070 [main] INFO  c.c.p.CwpProcessManager - Starting UI & PE AVM
14:19:47.070 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: order_negotiations - Internal Name:order_negotiations, Internal Version:00005000, Version:5.1.1
14:19:47.071 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: system - Internal Name:Unspecified, Internal Version:Unspecified, Version:5.0 Beta build 5.0.47 (22546) - Oct 27 2009
14:19:47.071 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: externalSchema - Internal Name:Unspecified, Internal Version:Unspecified, Version:OMS
14:19:47.071 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: order_negotiations_lib - Internal Name:order_negotiations_lib, Internal Version:00005000, Version:5.1.1
14:19:47.071 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: data_order - Internal Name:data_order, Internal Version:00005000, Version:Unspecified
14:19:47.071 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: catalog - Internal Name:catalog, Internal Version:00005222, Version:5.1 Catalog
14:19:47.071 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: serviceOrchestrationFramework - Internal Name:serviceOrchestrationFramework, Internal Version:20120815, Version:Unspecified
14:19:47.071 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: wizard - Internal Name:wizard, Internal Version:00005000, Version:5.1
14:19:47.071 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: data_dictionary - Internal Name:data_dictionary, Internal Version:00005000, Version:Unspecified
14:19:47.072 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: cwInitialization - Internal Name:cwInitialization, Internal Version:00005000, Version:Unspecified
14:19:47.072 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: SIDCommon - Internal Name:SIDCommon, Internal Version:00005201, Version:Unspecified
14:19:47.072 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: catalogClient - Internal Name:catalogClient, Internal Version:00005206, Version:5.1 Catalog Client
14:19:47.120 [main] INFO  c.conceptwave.cui.avm.Avm - AVM: Stopping
14:19:57.173 [main] INFO  c.conceptwave.cui.avm.Avm - AVM: Stopped
14:19:57.173 [main] INFO  c.c.s.c.CommandLineMode - Node(s): node2 started ok
14:19:57.249 [main] INFO  c.c.s.c.CommandLineMode - Activated nodes node2 with version D854

Author

Commented:
HI ,
this is the output .  Ignore the older one:-

19:21:33.056 [main] INFO  c.c.s.ServiceDesigner - Starting ConceptWave Design Studio - 5.2.4.6 (b1336) 02/26/2014 02:26 PM (-help for options)
19:21:33.104 [main] INFO  c.c.s.ServiceDesigner - Log files saved in /data/Conceptwave_5.2.4.6/designer/env/log
19:21:33.126 [main] INFO  c.c.s.c.CommandLineMode - activate mode
19:21:33.141 [main] INFO  com.conceptwave - Signed license file license.lic
19:22:22.293 [main] INFO  c.c.r.CwfSystem - total metadata compilation: 15
19:22:22.294 [main] INFO  c.c.r.CwfSystem -  > total process compilation: 1
19:22:22.294 [main] INFO  c.c.r.CwfSystem -   >> total process activity compilation: 0
19:22:23.362 [main] WARN  com.conceptwave.data - DW0103: Privilege "omsTaskContext" not found in the user profile system
19:22:23.363 [main] WARN  com.conceptwave.data - DW0103: Privilege "cwt_omSupport" not found in the user profile system
19:22:23.363 [main] WARN  com.conceptwave.data - DW0103: Privilege "cwtCUAddrAdmin" not found in the user profile system
19:22:23.363 [main] WARN  com.conceptwave.data - DW0103: Privilege "cwtCUPartyAdmin" not found in the user profile system
19:22:23.531 [main] INFO  c.c.p.CwpProcessManager - Starting UI & PE AVM
19:22:23.531 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: order_negotiations - Internal Name:order_negotiations, Internal Version:00005000, Version:5.1.1
19:22:23.532 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: system - Internal Name:Unspecified, Internal Version:Unspecified, Version:5.0 Beta build 5.0.47 (22546) - Oct 27 2009
19:22:23.532 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: externalSchema - Internal Name:Unspecified, Internal Version:Unspecified, Version:OMS
19:22:23.532 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: order_negotiations_lib - Internal Name:order_negotiations_lib, Internal Version:00005000, Version:5.1.1
19:22:23.532 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: data_order - Internal Name:data_order, Internal Version:00005000, Version:Unspecified
19:22:23.532 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: catalog - Internal Name:catalog, Internal Version:00005222, Version:5.1 Catalog
19:22:23.532 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: serviceOrchestrationFramework - Internal Name:serviceOrchestrationFramework, Internal Version:20120815, Version:Unspecified
19:22:23.532 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: wizard - Internal Name:wizard, Internal Version:00005000, Version:5.1
19:22:23.533 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: data_dictionary - Internal Name:data_dictionary, Internal Version:00005000, Version:Unspecified
19:22:23.533 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: cwInitialization - Internal Name:cwInitialization, Internal Version:00005000, Version:Unspecified
19:22:23.533 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: SIDCommon - Internal Name:SIDCommon, Internal Version:00005201, Version:Unspecified
19:22:23.533 [main] INFO  c.c.p.CwpProcessManager - Loaded Template: catalogClient - Internal Name:catalogClient, Internal Version:00005206, Version:5.1 Catalog Client
19:22:23.581 [main] INFO  c.conceptwave.cui.avm.Avm - AVM: Stopping
19:22:33.641 [main] INFO  c.conceptwave.cui.avm.Avm - AVM: Stopped
19:22:33.642 [main] INFO  c.c.s.c.CommandLineMode - Node(s): node2 started ok
19:22:33.721 [main] INFO  c.c.s.c.CommandLineMode - Activated nodes node2 with version D1052
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
If following command is working:
/usr/bin/ssh omsuat1@eocecmuiuat1.kpno.be "/data/Conceptwave_5.2.4.6/designer/env/runActivate.sh OMSEPC@eocecmdbuat2.kpno.be:1511:OMSEPCUAT2 /data/CWMetadata/Metadata/cwf.war node1 active;exit"

Open in new window

then following need to work inside other script:
/usr/bin/ssh omsuat1@eocecmuiuat1.kpno.be "/data/Conceptwave_5.2.4.6/designer/env/runActivate.sh OMSEPC@eocecmdbuat2.kpno.be:1511:OMSEPCUAT2 /data/CWMetadata/Metadata/cwf.war node1 active;exit" >>"$OUTPUT_FILE" 2>&1

Open in new window

Give us the output for following commands:
/usr/bin/file Deployment.sh

Open in new window


/bin/cat Deployment.sh

Open in new window



/usr/bin/od -bc Deployment.sh

Open in new window

Author

Commented:
HI,
Just to highlight you one thing here. I need to run thi runActivate command on main server as well as remote server. In my script ,it is failing in main server itself.

This runActivate comamnds need one password.So script exit there only.

This is the command :-

/data/Conceptwave_5.2.4.6/designer/env/runActivate.sh OMSEPC@eocecmdbuat2.kpno.be:1511:OMSEPCUAT2 /data/CWMetadata/Metadata/cwf.war node1 active
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
I have to leave for the day.
Tomorrow giving some training here.
I will look into this coming Saturday(20/May/2017).
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
Before executing following commands
open putty.exe
Load the saved sessions
click logging:
Session logging:
 Enable All session output
Log file name:
C:\users\yourUserNAme\&h_&d_&m_&y.txt
Enable Always overwrite it
Click save in saved sessions.
Then login.

Then you execute following command in your system where you are getting error:
and let us know the full output (providing related putty log file)
$ #echo go to a sub shell
$ /bin/ksh
$ #inside current shell execute following commands
$ set -x
$ . ./ScriptName.sh Parameters

Open in new window

Author

Commented:
ok i will try and let you know the output
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
No try
>> Sumit Prakash
:)

Provide the same, which I will view tomorrow at office (of course I do not have Linux system at office, but I can verify using cygwin:) )

Author

Commented:
HI ,

It is still throwing the erro:-

bash-3.2$ . ./Deployment.sh feb2015
You will get output and error in Output_21_May_2017_23_27_28_%N

bash-3.2$ more Output_21_May_2017_23_27_28_%N
INFO  - Starting ConceptWave Design Studio - 5.2.4.6 (b1336) 02/26/2014 02:26 PM (-help for options)
INFO  - Log files saved in /data/Conceptwave_5.2.4.6/designer/env/log
INFO  - activate mode
INFO  - Signed license file license.lic
ERROR - Password must be specified if the console has been redirected or running inside eclipse.


My script is below:-

#!/bin/bash
#set -x

OUTPUT_FILE="Output_"''`/bin/date "+%d_%b_%Y_%H_%M_%S_%N"`''

/data/Conceptwave_5.2.4.6/designer/env/runActivate.sh OMSEPC@eocecmdbuat1.kpno.be:1511:OMSEPCUAT1 /data/CWMetadata/Metadata/cwf.war node2 active >"$OUTPUT_FILE" 2>&1
echo You will get output and error in $OUTPUT_FILE

Author

Commented:
Here is the main commandwhich i run in putty without script:-

bash-3.2$ cd /data/Conceptwave_5.2.4.6/designer/env
bash-3.2$ ./runActivate.sh OMSEPC@eocecmdbuat1.kpno.be:1511:OMSEPCUAT1 /data/CWMetadata/Metadata/cwf.war node2 active
INFO  - Starting ConceptWave Design Studio - 5.2.4.6 (b1336) 02/26/2014 02:26 PM (-help for options)
INFO  - Log files saved in /data/Conceptwave_5.2.4.6/designer/env/log
INFO  - activate mode
INFO  - Signed license file license.lic
[Database Password:]
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
In your code
Replace:
#!/bin/bash
#set -xOUTPUT_FILE="Output_"''`/bin/date "+%d_%b_%Y_%H_%M_%S_%N"`''
/data/Conceptwave_5.2.4.6/designer/env/runActivate.sh OMSEPC@eocecmdbuat1.kpno.be:1511:OMSEPCUAT1 /data/CWMetadata/Metadata/cwf.war node2 active >"$OUTPUT_FILE" 2>&1
echo You will get output and error in $OUTPUT_FILE

Open in new window

With:
#!/bin/bash
set -x
OUTPUT_FILE="Output_"''`/bin/date "+%d_%b_%Y_%H_%M_%S"`''".txt"
/data/Conceptwave_5.2.4.6/designer/env/runActivate.sh OMSEPC@eocecmdbuat1.kpno.be:1511:OMSEPCUAT1 /data/CWMetadata/Metadata/cwf.war node2 active 2>&1 | /usr/bin/tee -a "$OUTPUT_FILE" 2>&1
set +x
echo You will get output and error in $OUTPUT_FILE

Open in new window


Provide the following(waiting for the same):

a)Putty log file.
Related

steps to follow for putty log file.


b)
$ #echo go to a sub shell
$ /bin/ksh
$ #inside current shell execute following commands
$ set -x
$ . ./ScriptName.sh Parameters

Open in new window

c)
/usr/bin/file Deployment.sh

Open in new window

d)
/usr/bin/od -bc Deployment.sh

Open in new window

MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
Waiting for your reply providing putty log at 05:03 AM IST.
Of course while uploading putty log file
1.  do not provide password
Also because of editing putty log file, better change only related changes(example: excluding password) alone.

Author

Commented:
Below are the output i got on console:-

bash-3.2$ cd /data/Conceptwave_5.2.4.6/designer/env
bash-3.2$ /usr/bin/file Deployment.sh
Deployment.sh:  commands text
bash-3.2$
bash-3.2$ /usr/bin/od -bc Deployment.sh
0000000 044 040 043 145 143 150 157 040 147 157 040 164 157 040 141 040
           $       #   e   c   h   o       g   o       t   o       a
0000020 163 165 142 040 163 150 145 154 154 012 044 040 057 142 151 156
           s   u   b       s   h   e   l   l  \n   $       /   b   i   n
0000040 057 153 163 150 012 044 040 043 151 156 163 151 144 145 040 143
           /   k   s   h  \n   $       #   i   n   s   i   d   e       c
0000060 165 162 162 145 156 164 040 163 150 145 154 154 040 145 170 145
           u   r   r   e   n   t       s   h   e   l   l       e   x   e
0000100 143 165 164 145 040 146 157 154 154 157 167 151 156 147 040 143
           c   u   t   e       f   o   l   l   o   w   i   n   g       c
0000120 157 155 155 141 156 144 163 012 044 040 163 145 164 040 055 170
           o   m   m   a   n   d   s  \n   $       s   e   t       -   x
0000140 012 044 040 056 040 056 057 123 165 155 151 164 056 163 150 040
          \n   $       .       .   /   S   u   m   i   t   .   s   h
0000160 146 145 142 062 060 061 065
           f   e   b   2   0   1   5
0000167

Author

Commented:
Putty.log is below:-

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2017.05.23 23:36:12 =~=~=~=~=~=~=~=~=~=~=~=
login as: omsuat1
Using keyboard-interactive authentication.
Password:
Last login: Tue May 23 23:27:26 2017 from 10.122.3.135

Oracle Corporation      SunOS 5.10      Generic Patch   January 2005
You have new mail.
-bash-3.2$ bash
bash-3.2$ nohup ./startNodeManager.sh start
bash-3.2$ clear./startNodeManager.sh stop
bash-3.2$ nohup ./startNodeManager.sh start
bash-3.2$ ./startNodeManager.sh stop
bash-3.2$ clearnohup ./startNodeManager.sh start
bash-3.2$ cd /data/Conceptwave_5.2.4.6/designer/env
bash-3.2$ /usr/bin/file Deployment.sh
Deployment.sh:  commands text
bash-3.2$
bash-3.2$ /usr/bin/od -bc Deployment.sh
0000000 044 040 043 145 143 150 157 040 147 157 040 164 157 040 141 040
           $       #   e   c   h   o       g   o       t   o       a    
0000020 163 165 142 040 163 150 145 154 154 012 044 040 057 142 151 156
           s   u   b       s   h   e   l   l  \n   $       /   b   i   n
0000040 057 153 163 150 012 044 040 043 151 156 163 151 144 145 040 143
           /   k   s   h  \n   $       #   i   n   s   i   d   e       c
0000060 165 162 162 145 156 164 040 163 150 145 154 154 040 145 170 145
           u   r   r   e   n   t       s   h   e   l   l       e   x   e
0000100 143 165 164 145 040 146 157 154 154 157 167 151 156 147 040 143
           c   u   t   e       f   o   l   l   o   w   i   n   g       c
0000120 157 155 155 141 156 144 163 012 044 040 163 145 164 040 055 170
           o   m   m   a   n   d   s  \n   $       s   e   t       -   x
0000140 012 044 040 056 040 056 057 123 165 155 151 164 056 163 150 040
          \n   $       .       .   /   S   u   m   i   t   .   s   h    
0000160 146 145 142 062 060 061 065
           f   e   b   2   0   1   5
0000167
bash-3.2$ /usr/bin/od -bc Deployment.shfile Deployment.sh
Deployment.sh:  commands text
bash-3.2$ /usr/bin/file Deployment.sh[2@od -bc Deployment.sh
0000000 044 040 043 145 143 150 157 040 147 157 040 164 157 040 141 040
           $       #   e   c   h   o       g   o       t   o       a    
0000020 163 165 142 040 163 150 145 154 154 012 044 040 057 142 151 156
           s   u   b       s   h   e   l   l  \n   $       /   b   i   n
0000040 057 153 163 150 012 044 040 043 151 156 163 151 144 145 040 143
           /   k   s   h  \n   $       #   i   n   s   i   d   e       c
0000060 165 162 162 145 156 164 040 163 150 145 154 154 040 145 170 145
           u   r   r   e   n   t       s   h   e   l   l       e   x   e
0000100 143 165 164 145 040 146 157 154 154 157 167 151 156 147 040 143
           c   u   t   e       f   o   l   l   o   w   i   n   g       c
0000120 157 155 155 141 156 144 163 012 044 040 163 145 164 040 055 170
           o   m   m   a   n   d   s  \n   $       s   e   t       -   x
0000140 012 044 040 056 040 056 057 123 165 155 151 164 056 163 150 040
          \n   $       .       .   /   S   u   m   i   t   .   s   h    
0000160 146 145 142 062 060 061 065
           f   e   b   2   0   1   5
0000167
bash-3.2$
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
Test the updated script.

Two sample outputs here:
a)
$ ./Development.sh
/cygdrive/c/windows/system32/ping eocecmdbuat1.kpno.be
Ping request could not find host eocecmdbuat1.kpno.be. Please check the name and try again.
Current output or error file location: Output_24_May_2017_12_07_47.txt
$

Open in new window

b)
./Development.sh -debug
Since -debug option used
Displaying usage of related command in /cygdrive/c/Users/MurugesanDinesh/runActivate.sh:
/cygdrive/c/ProgramData/Oracle/Java/javapath/java -Xms1024m -Xmx1024m -XX:MaxPermSize=128m -Djava.awt.headless=true -cp /data/Conceptwave_5.2.4.6/designer/Designer.jar:/data/Conceptwave_5.2.4.6/lib/oracle/ojdbc6.jar:/data/Conceptwave_5.2.4.6/lib/oracle/orai18n.jar:/data/Conceptwave_5.2.4.6/lib/oracle/orai18n-mapping.jar:/data/Conceptwave_5.2.4.6/lib/ilog/sdworkflowmodeler.deployed.jar:/data/Conceptwave_5.2.4.6/lib/jdic/JDICplus.jar:/data/Conceptwave_5.2.4.6/lib/axis2/addressing-1.41.mar:/data/Conceptwave_5.2.4.6/lib/axis2/rampart-1.5.mar:/data/Conceptwave_5.2.4.6/lib/axis2/mex-1.4.1.mar:/data/Conceptwave_5.2.4.6/lib/axis2/wstx-asl-3.2.4.jar:/data/Conceptwave_5.2.4.6/lib/axis2/rampart-core-1.5.jar:/data/Conceptwave_5.2.4.6/lib/axis2/rampart-policy-1.5.jar -Dcom.sun.management.jmxremote.port=10009 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false com.conceptwave.servicedesigner.ServiceDesigner -activate -jdbc=OMSEPC@eocecmdbuat1.kpno.be:1511:OMSEPCUAT1 /data/CWMetadata/Metadata/cwf.war node2 active -debug
Current output or error file location: Output_24_May_2017_12_00_42.txt

Open in new window

Development.sh
runActivate.sh

Author

Commented:
I will test this tomorrow morning and will let you know the output
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
$ #>> tomorrow morning
$ #My comment for fun:)
$ echo "I read your comment at "''`/bin/date "+%a %b %d %H:%M:%S %Z %Y"`''
I read your comment at Mon May 29 08:35:38 IST 2017

Open in new window

/bin/date "+%Z"
IST

Author

Commented:
Actually i have only 2 environment .one production and another is UAT . So on UAT always tester are working on it ,and i dont want to raise any voice against me.

Cna you tell me the code that you have given to me will execute that runactivate command .
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
Execute the given code on ID: 421480925d

Author

Commented:
Hello Murugesan,

I cannot chage runActivate.sh command as this is Ericson script .
Can i call you
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
sent message to you.
I feel that your time do not belong to IST
Hence call me at provide timings mentioned in the message provide to you.

Author

Commented:
Hi ,

Sent message to you.

Author

Commented:
bash-3.2$  cd /data/Conceptwave_5.2.4.6/designer/env
bash-3.2$ ./runActivate.sh OMSEPC/feb2015@eocecmdbuat1.kpno.be:1511:OMSEPCUAT1 /data/CWMetadata/Metadata/cwf.war node2 active
INFO  - Starting ConceptWave Design Studio - 5.2.4.6 (b1336) 02/26/2014 02:26 PM (-help for options)
INFO  - Log files saved in /data/Conceptwave_5.2.4.6/designer/env/log
INFO  - activate mode
INFO  - Signed license file license.lic
ERROR - Password must be entered from the console unless the console has been redirected.
bash-3.2$
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
Inside the script
Replace
/fullpath/java parameter
With:
echo /fullpath/java parameter

Open in new window

Let us know the output?
Application Development and Automation Management
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks a ton for your help.
MURUGESAN NApplication Development and Automation Management
CERTIFIED EXPERT

Commented:
# echo -n "Most welcome" | /usr/bin/wc
      0       2      12
Number of lines (having \n) => 0 => since used echo -n
Number of words => 2
Number of characters => 12
# echo -n "Most Welcome"
Most Welcome# /bin/pwd
/
# echo  "Most Welcome"
Most Welcome
#

Open in new window

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.