The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
File transfer between unix and windows server Tlg13team HP-UX 2 02-08-2008 07:40 AM
Transfer file from local unix server to remote server indira Shell Programming and Scripting 2 05-03-2007 03:35 AM
Transfer file from local unix server to remote server indira HP-UX 2 05-02-2007 02:15 PM
server Hangs during FTP transfer sgoundar Filesystems, Disks and Memory 0 05-21-2006 03:33 PM
Transfer files from Unix server to Windows using FTP gjsaravanan UNIX for Dummies Questions & Answers 1 08-22-2005 04:55 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 12-16-2007
Registered User
 

Join Date: Apr 2006
Posts: 74
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:

Code:
data = /abc/web/docs/xyz.com/props

scp $data/.*zip. fast:/xyz/abc/mlo.com/klm
But unfortunately my script is not working. Any clues how can i acheieve this?

Thanks
Reply With Quote
Forum Sponsor
  #2  
Old 12-16-2007
Registered User
 

Join Date: Aug 2003
Location: Ireland
Posts: 269
Hi

When using scp the format should be as follows

scp <filename> user@foreignserver:<foreigndirectory>

ie..

scp test1.zip root@server1:/tmp
Reply With Quote
  #3  
Old 12-16-2007
Registered User
 

Join Date: Apr 2006
Posts: 74
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/abc.com/props. 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.
Reply With Quote
  #4  
Old 12-16-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
zip all the files into one zip file then scp the single zip file.
Reply With Quote
  #5  
Old 12-16-2007
Registered User
 

Join Date: Apr 2006
Posts: 74
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/xyz.com/temp)

scp test.zip tempuser@xyz: /home/web/xyz.com/temp

Am i correct?

Thank you
Reply With Quote
  #6  
Old 12-16-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Code:
scp test.zip tempuser@xyz:/home/web/xyz.com/temp
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 01:09 PM.
Reply With Quote
  #7  
Old 12-16-2007
Registered User
 

Join Date: Apr 2006
Posts: 74
Thank you porter. I will try this tomorrow at work and will post back :--). I appreciate all your help and frustrated.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 03:17 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0