Visit Our UNIX and Linux User Community

Transfer contents from one unix server to another

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Transfer contents from one unix server to another
# 1  
Old 12-16-2007
Transfer contents from one unix server to another

Hi Guys,

Well i dont have alot of experience in shell scripting. I am mostly into OOP. So i was given a task to

"Transfer the contents of files in a zip format from one unix server to another unix server"

What i am trying to do is create a shell script when runs will transfer all the files in zip format from one unix directory to another unix server directory. How can i do that?

I've searched on google and most of the time they used " scp " command. I am not at work but i tried using something like this:

data = /abc/web/docs/

scp $data/.*zip. fast:/xyz/abc/

But unfortunately my script is not working. Any clues how can i acheieve this?

# 2  
Old 12-16-2007

When using scp the format should be as follows

scp <filename> user@foreignserver:<foreigndirectory>


scp root@server1:/tmp
# 3  
Old 12-16-2007
Thank you for the reply frustrated.

Actually that might be correct for only one file command. What i am trying to do is that:-

I have bunch of files in one unix directory. The name of that unix server is ABC. /user/web/ This is the path to my unix directory. in the props folder i might have 30 files(html, txt, etc).

I have another unix server XYZ. What i am trying to do is transfer all the contents of props directory from ABC unix server to XYZ unix server in a zip file format.

Your code might work for one file but i have 30 files which i need to bundle into zip folder and then transfer it to my another server. Hope i am clear enough.
# 4  
Old 12-16-2007
zip all the files into one zip file then scp the single zip file.
# 5  
Old 12-16-2007
hmm good point porter. So the command should look something like this. If i would like to transfer that zip file into :

1) UNix server ( xyz)
2) Path (/home/web/

scp tempuser@xyz: /home/web/

Am i correct?

Thank you
# 6  
Old 12-16-2007
scp tempuser@xyz:/home/web/

You had an extra space following the ":"

Note also that the "scp" programs current directory on the remote end will start in the home directory of the user, so you can use relative paths if you so wish.

Last edited by porter; 12-16-2007 at 05:09 PM..
# 7  
Old 12-16-2007
Thank you porter. I will try this tomorrow at work and will post back :--). I appreciate all your help and frustrated.

Previous Thread | Next Thread
Test Your Knowledge in Computers #415
Difficulty: Easy
HTML, CSS, and JavaScript are the three core technologies of the World Wide Web.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Do I require remote login access to a windows server to transfer files from a UNIX server

Hi All I need to transfer a file from a UNIX server to a windows server. I saw that it is possible to do this using scp command by looking at the forum listed below: ... (2 Replies)
Discussion started by: vx04
2 Replies

2. Windows & DOS: Issues & Discussions

Transfer of zipped folder from windows desktop to UNIX server

Hi all, I'm a newbie to unix. My requirement is to create an automation script which will transfer a zipped folder from my/remote desktop to an unix server. Tools lik WinSCP shouldnt be used. No manual moving. I use putty to connect to server. I couldnt find any help on this topic. Should i use... (3 Replies)
Discussion started by: sherin22
3 Replies

3. Shell Programming and Scripting

File Transfer from Window server to UNIX and UNIX to UNIX

Dear All, Can someone help to command or program to transfer the file from windows to Unix server and from one unix server to another Unix server in secure way. I would request no samba client. (4 Replies)
Discussion started by: yadavricky
4 Replies

4. IP Networking

How to transfer files from UNIX server to windows machine or vice versa using ftp or sftp commands?

hi, i want to write a shell script code which transfers files from a directory in unix server to a directory in a windows machine.. can any1 give me a sample code which uses ftp or sftp command.. thanks very much, (3 Replies)
Discussion started by: Little
3 Replies

5. Shell Programming and Scripting

File transfer from one server to another server in unix

Hi, Can anyone help me. I am a new user in unix. I want to transfer (ftp) a file from one unix server to another server. Kindly help me. more details: server 1 file_name a.lst path: :/temp server 2 path : /develp/temp Thanks, Raj, (2 Replies)
Discussion started by: easterraj
2 Replies

6. UNIX and Linux Applications

Copy folder and its contents from HP Unix server to RH Linux

I am trying to copy a folder and all its contents from HP Unix box to RH linux, using the following. rsync -avz -e "ssh" /users/www/webroot/docFiles/Division/Ctry And it throws a consistent... (2 Replies)
Discussion started by: FanTom
2 Replies

7. HP-UX

File transfer between unix and windows server

hi all, I have two server(Unix tru64 and windows 2003 server). these server's live running now. The win2003server doesn't have ftp server. Also Unix server doesn't have samba. if both server's have ftp server that no problem. How to transfer file from windows server to unix by every... (2 Replies)
Discussion started by: Tlg13team
2 Replies

8. Shell Programming and Scripting

Transfer file from local unix server to remote server

want to remove this thread. thanks (2 Replies)
Discussion started by: indira
2 Replies

9. HP-UX

Transfer file from local unix server to remote server

want to remove the thread thanks (2 Replies)
Discussion started by: indira
2 Replies

10. UNIX for Dummies Questions & Answers

Transfer files from Unix server to Windows using FTP

Dear Friend, I don't know much about unix.I am an VB6.0 Programmer.I need to move an text files as aaa.txt from unix server to windows "D: " driver using the FTP protocol.Is it possible to do this with help of unix shell script.If possible please give some sample codes. Please answer as early... (1 Reply)
Discussion started by: gjsaravanan
1 Replies

Featured Tech Videos