[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

submit cmd file

Posted on 2012-08-31
12
Medium Priority
?
1,203 Views
Last Modified: 2012-09-04
Hi,
I've this cmd file (see attach file) that run on O.S. Linux RedHat 5.4 (2.6.18-308.1.1.el5)

I'd like to modify this cmd to start and stop some components of Oracle Access Manager
The command to start/stop are in rem command (example rem set COMMAND=. ~/.profile ; ls -l)


To start/stop the access server I must (user=omx IP=150.3.4.33):
Submit STOP_AS.CMD
then wait 2 minutes
and Submit START_AS.CMD

set COMMAND=. ~/.profile ; stop_access_server


To start/stop the identity server I must (user=odx IP=150.3.4.44):
Submit STOP_IS.CMD
then wait 2 minutes
and Submit START_IS.CMD

How can I modify this file and How can I write the command to wait 2 minutes between stop and start?
Start-exchange.cmd
0
Comment
Question by:ralph_rea
  • 7
  • 4
12 Comments
 
LVL 35

Expert Comment

by:Ernie Beek
ID: 38353788
You could use the 'sleep' command.
0
 
LVL 35

Expert Comment

by:Ernie Beek
ID: 38353793
Or, if it's unknow, download the resource tool kit: http://www.microsoft.com/en-us/download/details.aspx?id=17657
It's in there.
0
 

Author Comment

by:ralph_rea
ID: 38354022
Thanks!

if I start cmd file it run correctly open the Console - Quest Plink that display:
Starting tunnel...Using username "tunnel".
Waiting for tunnel...
Tunnel established !
Cleaning registry key
and then Authentication Required - Quest PuTTY for response the password.

Now I'd Like to connect to Linux shell via PuTTY. I run PuTTY.exe and in Hostname I put 150.3.4.6 Port: 22 SSH connection type but I can't get the login prompt.

What I wrong?
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 35

Expert Comment

by:Ernie Beek
ID: 38354130
So you're setting up a (VPN) tunnel to a remote system using that console and within the console it's then asking for the password? It looks to me that you are allready connecting to the shell within that console or am I mistaking?
It's not quite clear to me what you're trying to do exactely.
0
 

Author Comment

by:ralph_rea
ID: 38354303
In attach (start.doc) the steps I get when I start file Start-exchange.cmd.

Thanks
Start.doc
0
 
LVL 35

Expert Comment

by:Ernie Beek
ID: 38354352
I see that in start-exchange.cmd you start a console that runs KIX32:

start Apps\Console\Console.exe -d . -r "cmd /c Apps\Kix\KIX32.exe Custom\SSH.kix $PONTE=%PONTE% $SSHIP=%IP% $SSHUSER=%USER% $SSHCOMMAND=\"%COMMAND%\""

What's in the SSH.kix?
0
 

Author Comment

by:ralph_rea
ID: 38354407
if from dos I run:

start Apps\Console\Console.exe -d . -r "cmd /c Apps\Kix\KIX32.exe Custom\SSH.kix"

I get display in ssh_kix.doc file attached
ssh-kix.doc
0
 

Author Comment

by:ralph_rea
ID: 38354434
ops.....in attach file ssh.kix
SSH.txt
0
 
LVL 35

Expert Comment

by:Ernie Beek
ID: 38354443
That's not quite what I meant ;)

I would like to know what is in the SSH.kix file. It's a text file so you can open it with notepad or similar.
0
 
LVL 35

Expert Comment

by:Ernie Beek
ID: 38354446
Ah, thx.
0
 
LVL 35

Accepted Solution

by:
Ernie Beek earned 2000 total points
ID: 38354611
Ok, I think I got it.

In the KIX script an SSH tunnel connection is set up to a remote device (150.3.4.6) and linked to port 2222 at your localhost (127.0.0.1). After that, the commands defined in set COMMAND are run through an SSH connection at 127.0.0.1 port 2222.

My guess would be that if you see the Continuare? prompt, that tunnel is still open and you should be able to connect using putty to 127.0.0.1 port 2222 (instead of IP 150.3.4.6 and port 22).
0
 
LVL 11

Expert Comment

by:paultomasi
ID: 38356013
The following command will pause a batch file for 2 minutes:

    ping 127.0.0.1 -n 120 -w 1000 >nul
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Often times it's very very easy to extend a volume on a Linux instance in AWS, but impossible to shrink it. I wanted to contribute to the experts-exchange community a way of providing a procedure that works on an AWS instance. It can also be used on…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question