Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remote find for ftp

Status
Not open for further replies.

nimrodman

MIS
Nov 22, 2005
43
US
I am having an issue that I know does have a simple solution, but I cannot seem to get it resolved, this is it; I have a script that I have written which works perfectly well, it calls a script on a remote server to find files depending on certain file mask, but what I want to do is to make both scripts into one, but I cannot seem to get the logic right.
In plain English, is there a way to run a batch of commands on a remote server?

I have tried ssh with remote command, but I am able to run only a single line and I cannot run functions in that way, this is a real enigmatic situation, but I do say that I am perplexed, help anyone?
 
what I want to do is to make both scripts into one
Which scripts ?


Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
You probably want to execute a remote script that doesn't exist on the remote machine.

One would be to scp over first (or rsync it so it is always up to date) so you can call it remotely.

Another is to export it from a NFS device and call it from a remote mount (if automounter is running and NFS isn't blocked.

You are right, there is no clean way of getting the logic of a script with remote execution without the script existing on the remote machine in some manner or rewriting the script severely.

eugene
 
As long as the script to run on the remote host is not too big, and you can get your shell escapes right, you can simply include its entire contents in the ssh command, e.g.:

Code:
ssh remotehost '
    second 
    script
    here
'

Naturally if the second script contains any sections surrounded by single quotes you will have some interesting manipulation to do to make sure it arrives at the remote host intact.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top