Sponsored Content
Top Forums Shell Programming and Scripting Connect to server-1 from server-2 and get a file from server-1 Post 302830333 by dhruuv369 on Monday 8th of July 2013 02:16:18 PM
Old 07-08-2013
I put your code in a file by name, "ftp_test.sh".
Code:
cat ftp_test.sh

gives me
Code:
/usr/bin/ftp -n ftpsitename.com <<EOF
quote USER 12345
quote PASS 12345
mget /FILENAME* /directory_location_to/copy/on_server2/
EOF

and I use
Quote:
sh ftp_test.sh
to run the script on server2, I am now getting the following error:
Quote:
Filename provided by server doesn't match pattern `/FILENAME*': FILENAME26.txt
Refusing to handle insecure file list
Currently, FILENAME26.txt is the only file available on the server1.

So I tried to give the exact file name which is present on server1 and changed "mget" to "get" to check if this copies the file on server2 location (/directory_location_to/copy/on_server2/) this time, now the script looks like
Code:
cat ftp_test.sh
/usr/bin/ftp -n ftpsitename.com <<EOF
quote USER 12345
quote PASS 12345
get /FILENAME26.txt /directory_location_to/copy/on_server2/
EOF

i get a different error:
Quote:
/directory_location_to/copy/on_server2/: No such file or directory.
mget FILENAME26.txt?
However, I checked on server 2 if the directory
Quote:
/directory_location_to/copy/on_server2/
exists or not, and it does exist... I even tried to get the file on server2 home directory, but I get the same error as above... How does the command know to put the file on the server2(since we are not mentioning about it in the code)??? any further suggestion on this???
 

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

To Connect to Windows server from Unix server

Hi i am writing a script in unix where after some validations, i require the script to connect to a windows server and then kich off a batch file there. i tried ftp and got the error message that "the remote host refused an attempted connect operation". I am able to connect to this unix... (4 Replies)
Discussion started by: vidzz911
4 Replies

2. Shell Programming and Scripting

Connect to Server B from Server A and Archive the file

Hi I need to connect to a ServerB from Server A eg: Server A : 172.20.273.51, un: xxx, pwd: xxx Server B: 172.20.273.51, un:yyy, pwd: yyy Need to copy the files(with name starts with IME*) from /grid/pc/IME* to /grid/pc/archive What will be the command or script to... (3 Replies)
Discussion started by: vsmeruga
3 Replies

3. Linux

Generate public key to connect from one ftp server to other server

How to generate public key to connect from one ftp server to other server to use in scripting. (0 Replies)
Discussion started by: sridhardwh
0 Replies

4. UNIX for Advanced & Expert Users

Public key to connect from one ftp server to other server

How to generate public key to connect from one ftp server to other server to use in scripting. (1 Reply)
Discussion started by: sridhardwh
1 Replies

5. Shell Programming and Scripting

Connect (SSH) to Windows server via Linux server through a script and passing command.. but failing

I am trying to connect to Windows server via Linux server through a script and run two commands " cd and ls " But its giving me error saying " could not start the program" followed by the command name i specify e g : "cd" i am trying in this manner " ssh username@servername "cd... (5 Replies)
Discussion started by: sunil seelam
5 Replies

6. UNIX for Dummies Questions & Answers

Transfer file from server B to server C and running the script on server A

I have 3 servers A, B, C and server B is having some files in /u01/soa/ directory, these files i want to copy to server C, and i want to run the script from server A. Script(Server A) --> Files at Server B (Source server) --> Copy the files to Server C(Target Server). We dont have RSA key... (4 Replies)
Discussion started by: kiran_j
4 Replies

7. Shell Programming and Scripting

Connect to one server from other server without asking password

Hi , I am using redhat linux 5.I.I need a command or script which need to login from one server to another without asking password.This can be done even providing password on the command line is also fine.I have tries sshpass but it didn't work.ssh key generations is not preferred here. ... (7 Replies)
Discussion started by: muraliinfy04
7 Replies

8. Linux

How to connect Linux server (configure two way authentication) with Windows server?

Hi my name is Manju. ->I have configure the two way authentication on my linux server. ->Now I am able to apply two way authenticator on particuler user. ->Now I want to map this linux server to my AD server. ->Kindly tell me how to map AD(Active Directory) with this linux server. ... (0 Replies)
Discussion started by: manjusharma128
0 Replies

9. Shell Programming and Scripting

How to connect from one server(Current) to another server?

Hi, I have something like this. I have connected to one server ServerA and from this ServerA, i need to do ssh connection to ServerB and then execute my queries. #!/usr/bin/expect spawn ssh Myusername@ServerB expect "password" send "Mypassword\r" interact Output.ksh: spawn: not... (5 Replies)
Discussion started by: Samah
5 Replies

10. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies
NNTP-PULL(1)							 nntp-pull manual						      NNTP-PULL(1)

NAME
nntp-pull - fetch articles from the server to the mbox SYNOPSIS
nntp-pull [options...] groupname [groupname...] DESCRIPTION
Fetch messages from the server and save them into the mailbox (mbox format). Every argument is supposed to be a name of group, optionally followed by a '>' character and mbox filename. If the mbox filename is omitted, it defaults to the name of the group. Besides global options (described in sinntp(1)), nntp-pull command takes following options: --limit=N Pull at most N messages. --reget Start from the first available message. EXAMPLES
nntp-pull --server=news.example.org --limit=50 'comp.os.linux>os-linux' Fetches at most the 50 newest articles from the newsgroup comp.os.linux located on news.example.org server and appends them to the os-linux mailbox file. nntp-pull --server=news.example.net --reget --limit=3 comp.os.windows Fetches at most the 3 oldest articles from the newsgroup comp.os.windows located on news.example.net server and appends them to the comp.os.windows mailbox file. SEE ALSO
sinntp(1) COPYRIGHT
Copyright (C) 2009, 2010, 2011 Piotr Lewandowski, Jakub Wilk nntp-pull 1.5 2012-04-18 NNTP-PULL(1)
All times are GMT -4. The time now is 05:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy