Execution of local commands for remote site.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Execution of local commands for remote site.
# 8  
Old 12-03-2013
so look if you have remsh command:
Code:
 which remsh

then test if it is allowed
Code:
 remsh <remote-host>

using the remote host name...
# 9  
Old 12-04-2013
remsh is not available, only rsh is available.
# 10  
Old 12-04-2013
Quote:
Originally Posted by attillam
remsh is not available, only rsh is available.
These two are the same. In fact in some systems one is a link ot the other. On AIX 7.1, for instance, they are not links but:

Code:
# which rsh
/usr/bin/rsh
# ls -l /usr/bin/rsh
-r-sr-xr-x    2 root     system        27788 Sep 11 2012  /usr/bin/rsh
# ls -l /usr/bin/remsh
-r-sr-xr-x    2 root     system        27788 Sep 11 2012  /usr/bin/remsh
# diff -b /usr/bin/rsh /usr/bin/remsh

#

Issue a

Code:
rsh remote.host.com date

to see if it works. It might be that a firewall blocks it, the remote host refuses to accept that protocol or probably several other reasons i just can't antecipate right now.

At any rate, it would be preferable by a huge margin to use securified commands, namely ssh to accomplish what you want.

I hope this helps.

bakunin
# 11  
Old 12-04-2013
Unfortunately I can't do this, because remote system is openvms, only local site is Solaris. I look for another solution.
# 12  
Old 12-04-2013
Create the following script "ftp_mydel.sh" and make it executable:
Code:
#!/bin/sh
set -e
machine=${1:-ftp}
owd=$PWD
cd
[ -f .netrc ] || {
> .netrc
chmod 600 .netrc
}
cp -p .netrc .netrc.old
set +e
(
sed "/^machine $machine/"',/^$/d' .netrc.old
echo "machine $machine"
echo "macdef mydel"
cd $owd
ls |
while read f
do
  [ -f "$f" ] && echo "del $f"
done
echo ""
) > .netrc

Go into your ftp download folder
Then run the script with
Code:
./ftp_mydel.sh ftpserver

where ftpserver is your ftp server or its IP address.
Look at the created ftp macro (with del commands)
Code:
cat ~/.netrc

Then run
Code:
ftp ftpserver

login
and run the macro with the $ command
Code:
$ mydel

# 13  
Old 12-05-2013
Thank you dear friends.

I found a solution,


1. opened a ftp connection giving a filelist,
2. prepared a file containing both get and delete lines using that filelist
and ftp connection parameters
3. execute this file.
# 14  
Old 12-05-2013
Quote:
Originally Posted by attillam
Unfortunately I can't do this, because remote system is openvms, only local site is Solaris. I look for another solution.
OPENVMS - what a delight!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copy from local to remote

Hi I need a advice for writing simple bash script, I have a file pod.txt which contains source location and remote location: /mnt/infile/20141103/701_0001.png/remote/tmp/pk21730/p0330223723074.png /mnt/infile/20141103/203_0001.png/remote/tmp/pk21731/p0330223723081.png and I must copy ... (6 Replies)
Discussion started by: primo102
6 Replies

2. Shell Programming and Scripting

Pause processes in remote host and resume execution in another remote host

Hi, Given addresses of 2 remote machines, using a shell script is it possible to get the state of running processes in "src" stop all the processes in "src" exit out of "src" ssh into "dest" resume the state of executing processes captured in step 1 in "dest" Assumption: "src" is... (3 Replies)
Discussion started by: Saeya Darsan
3 Replies

3. Shell Programming and Scripting

To run a local shell script in a remote machine by passing arguments to the local shell script

I need to run a local shell script on a remote machine. I am able to achieve that by executing the command > ssh -qtt user@host < test.sh However, when I try to pass arguments to test.sh it fails. Any pointers would be appreciated. (7 Replies)
Discussion started by: Sree10
7 Replies

4. Solaris

Remote execution of a local script on multiple servers

So I have a scriptlet called solaris_command: for i in \ server1 server2 server3 do echo $i ssh $i $1 echo "" done I then use that as a command in multiple scripts to allow for data gathering for all virtual hosts in the environment thusly: solaris_command "cat... (3 Replies)
Discussion started by: os2mac
3 Replies

5. HP-UX

configuring site-local IPv6 address

How do I configure site-local IPv6 address in HP-UX box? I can get link local IPv6 address automatically when I put IPv6 up. aps39-88-root# ifconfig lan0 inet6 up (0 Replies)
Discussion started by: kirtikjr
0 Replies

6. Web Development

Creating a blog site on a local computer

Hello! I would like to create a blog website on a web domain of mine. The blog will be used for publishing economics-lated articles. I tried to use a few open source packages for blog creation (WorldPress, b2evolution, Movable type) which I wanted to test on a local computer before arranging... (5 Replies)
Discussion started by: degoor
5 Replies

7. Shell Programming and Scripting

Can BASH execute commands on a remote server when the commands are embedded in shell

I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config. I am not sure if I can do this with BASH scripting. I have set up password less login by adding my public key to authorized_keys file, it works. I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies

8. UNIX for Advanced & Expert Users

Commands to copy a tar.gz file from a Remote Unix Server to Local Desktop.

Hi, Just wanted to know, how can I ftp/transfer/copy a (design.tar.gz) archive from a Unix Server (sdmc222.sdmc.cp-srv.com) which is at a remote location, to my Windows Desktop. Obviously, it is not possible at cmd prompt on my Windows using the following commands :- ftp... (3 Replies)
Discussion started by: marconi
3 Replies

9. SCO

Openserver 5.0.4 can't be ping or telnet into from a remote site

Hi, Can anybody help me out why l can't not ping my server with Openserver 5.0.4 with my windows machine from a remote site. The machine could see the local LAN with the Router however, i can't ping or telnet unto the server from another site on the WAN. The default gateway was configure on the... (0 Replies)
Discussion started by: kayode
0 Replies

10. Windows & DOS: Issues & Discussions

mapping FTP site as local drive

I have a small problem, there is one Win98 PC on our network, and I would like to map the FTP server that we have as one of the Win98's machine's local drives. I am by no means a Windows expert, instead my area is *NIX. The webserver is just a regualar webserver, within the LAN. I tried... (18 Replies)
Discussion started by: cerberusofhate
18 Replies
Login or Register to Ask a Question