Getting a file from other servers


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Getting a file from other servers
# 1  
Old 11-09-2005
Getting a file from other servers

Hi,
I need to write a shell script which will do the below operation.

Shell script will be executed in unix server A, it should get a file/directory from unix server B and store it in unix server A. How to do this?
# 2  
Old 11-09-2005
Is that with the same user ID? you can use ftp, rcp, etc.
nimo
# 3  
Old 11-09-2005
Yes ... u can just use ftp server name to connect to that server and download whatever u need .... ftp can be used inside the script as well ...

try something like this if u intend to do this from a shell script ...

(
echo "
open servername or ip number
user username passwd
bin
cd \"ur target path here\"
dir ur source path
mget filename
close
"
) | ftp -nv > TempLogFtp.log
# 4  
Old 11-10-2005
Hi,
Thanks for your reply, I know only the servername i don't know the user name and password then in that case how to do that?
# 5  
Old 11-10-2005
If you do not have access to that server (user name and password), then you cannot ftp or copy from it.
nimo
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with script checking for a file in various servers

I am trying to write a script that checks whether or not, a file exists on multiple servers. My code / logic so far is: #!/usr/bin/ksh print "Enter File name to be checked" read MYFILE ssh server1 " cd /var/opt/logs ; if then ... (4 Replies)
Discussion started by: momin
4 Replies

2. Shell Programming and Scripting

script to get all ip addresses of servers into a file

Hi all i need to create a script that pings every server in my range (0-254) adn then returns the values to a file? can anyone please help. i am working in the tcsh ( and yes i know how to ping ) but i dont know how to ping them all in one script without copying and pasting a 254 times? ... (1 Reply)
Discussion started by: brian112
1 Replies

3. Shell Programming and Scripting

Copy a file on remote servers

Hey Unix Gurus, I'm having trouble in copying a file on 5 different servers, first how can you do it locally (i.e without the need to ssh to the server you want to copy the file) and if you need to ssh how do u run a command within that server. Please see my code below(it doesn't work somehow).... (10 Replies)
Discussion started by: sexyTrojan
10 Replies

4. Shell Programming and Scripting

file transfer between two servers

Hi Frdz, Can any one help me out. I have a issue like below.i have to write shell script in unix. Server1 server2 ====== ======= 1.txt 1.txt 2.txt 3.txt I have to copy the files from server1 to server2 only... (6 Replies)
Discussion started by: KiranKumarKarre
6 Replies

5. UNIX for Dummies Questions & Answers

How to upload a file into 2 servers at the same time.

Hi, I'm new to unix/ Perl CGI. I have written Perl CGI scripts to upload a file into 2 servers at the same time using url redirection. But what happens is when i upload the file, it is getting uploaded in the first server properly and an empty file is uploaded in the second server( with the same... (7 Replies)
Discussion started by: kcpriya
7 Replies

6. Shell Programming and Scripting

File timestamps in different servers.

Hello, I need to gather timestamps and file sizes of all the list of files in different servers. The servers and file locations will be different for each file. I'm thinking of keeping a comman delimited file with {source_server_name,source location, file name} as records in the file. So, I... (1 Reply)
Discussion started by: bperl
1 Replies

7. UNIX for Advanced & Expert Users

File timestamp issue on HP servers

Hi All , I have a file which gets updated by a korn job daily . The file gets the latest timestamp on everyrun. But of late i have observed that the file timestamp gets modified to a older date ( Oct 25 2006 ) at some point in time of the day. This change has nothing to do with the job which... (5 Replies)
Discussion started by: siddaonline
5 Replies

8. Shell Programming and Scripting

Latest version of a file across the servers ..

:o How do I confirm that the script on one server is latest compare to other servers? Is there any script which can tell me the latest version of a file across the servers? Thanks, (2 Replies)
Discussion started by: Sandy
2 Replies

9. AIX

Script to ping servers in a file

I would like to ping a list of servers in a text file. Can anyone help? (1 Reply)
Discussion started by: gbarkhor
1 Replies

10. 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