Handling scripts in two different servers


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Handling scripts in two different servers
# 1  
Old 09-05-2014
Handling scripts in two different servers

Hi ,

My Script work as below

1-
On server 1

execute script1.sh ,

through this script one parameter file is generated as file.txt this is to transfer on server 2

2-
After reaching on server2 other shell script script2.sh execute using parameter file file.txt

This generate file new output file file2.txt now this is to be transfer back to server1

3-
where third shell script script3.sh executes using this output file.file2.txt

My Question is

how this can be handle with using two servers ?

scp port is not enable
# 2  
Old 09-06-2014
For that simple context, you don't necessarily need to copy files to and fro. Try
Code:
ssh user@server2 ./script2.sh <parameters >results

In script2.sh on server2, you read stdin for the parameters supplied from your local file, and all results are printed to stdout redirected to (local) results.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Executing scripts on remote servers

Hello all, I'm typing away a script that will send a script to a remote host and execute it. This is what i have at the moment and i was wondering if i can improve that or thats basicly what everybody does. Using bash on RHEL 5.5 To over simplify it... #!/bin/bash # start_ () { ... (3 Replies)
Discussion started by: maverick72
3 Replies

2. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

3. Shell Programming and Scripting

How do you guys run scripts against ALL your servers ?

I have 2000 odd servers (may of which are virtualisations) and if we want to run a script against all of them or distribute files/install software to all of them, we currently perform a simple for loop against a managed list of our servers called SLIST for host in `cat SLIST` ; do ssh $host... (1 Reply)
Discussion started by: rethink
1 Replies

4. Shell Programming and Scripting

Advanced error handling in shell scripts

Hi all I've got a question regarding error handling in shell scripts. My background is mainly object oriented programming languages, but for a year or so I've been doing more and more (bash) shell scripting (which I quite enjoy by the way). To handle errors in my scripts I... (3 Replies)
Discussion started by: script_man
3 Replies

5. Shell Programming and Scripting

Shell Scripts for automating server inventory for unix servers

Dear Team, I am very new to shell scripting & and presently monitoring unix boxes I am looking for a shell script which will give me the below output script should contain - hostname,OS Version,CPU details, Physical Memory, Partitions Details, Network Details and Software Installed,... (5 Replies)
Discussion started by: whizkidash
5 Replies

6. UNIX for Dummies Questions & Answers

Handling Errors in Shell Scripts

I have a shell script, which calls a load script to load a database. How can i handle errors in Unix(similar to 'error level' in Batch scripts)? I am trying to use 'mailx' to send a Success/failure message based on the error level returned by the load script. I have already used an error log... (2 Replies)
Discussion started by: sarsani
2 Replies

7. UNIX for Advanced & Expert Users

Error Handling in Korn Shell scripts

Hi, I am using few ISQL statements to update and delete from a few tables in sybase, now i want to roll back the transaction when any of the statements fail.How i can i capture these errors in the shell scripts.Please advise. Thanks, Gopi (4 Replies)
Discussion started by: bhgopi
4 Replies

8. Shell Programming and Scripting

Null handling in scripts

Hi, I face some problem with handling of nulls. I declare a variable - say i - and intialise to 0. Later I read it from console, wherein if I dont give any variable and press return key, I get this error: "0403-004 Specify a parameter with this command" Is there anyway to handle this error? ... (3 Replies)
Discussion started by: mohanprabu
3 Replies

9. UNIX for Dummies Questions & Answers

file handling across servers

hi all f1=demo1:/u2/test/test.doc (sco 5.0.5) f2=demo2:/u2/test/test.doc (solaris 5.8) how to use the files across servers? i.e. i want to copy the file from demo1 to demo2 with link (copy -l). replies appreciated. raguram R (3 Replies)
Discussion started by: raguramtgr
3 Replies
Login or Register to Ask a Question