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 !!

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 04-15-2007
Registered User
 

Join Date: Mar 2007
Posts: 11
ftp help

Does anyone know why I can't transfer a directory containing files from a remote directory to a local directory using psftp. If I take the file out of the directory but put it in the same place as where the directory was then I can get that file using psftp's get file command. Does not work for the directory (holding folder) though. Could it have something to do with permissions?
Reply With Quote
Forum Sponsor
  #2  
Old 04-15-2007
reborg's Avatar
Administrator
 

Join Date: Mar 2005
Location: Ireland
Posts: 3,590
It has nothing to do with permissions. Transfer of directories is simply not supported.
Reply With Quote
  #3  
Old 04-15-2007
Registered User
 

Join Date: Mar 2007
Posts: 11
So you're saying that if a directory(folder) is holding say 50 files in say ten sub-directories then the only option to transfer these files onto a local machine is to go into each sub-directory and transfer them from there?
Is there not a better way?
Reply With Quote
  #4  
Old 04-15-2007
awk awk is offline
Registered User
 

Join Date: Feb 2007
Posts: 119
If the remote system is a UNIX based one, have the directories/files tar'd into a single file, then compress the file (gzip is good) for faster transmission.

If you do this, be sure and use binary mode for transmission.

Then, on the destination machine, you would need to uncompress and untar the file.

tar is a common way to put multiple files in multiple directories into a single file for transmission or distribution.

If both systems supported pkzip, that would do it also.

But ftp is a "File transmission protocol", and while it will handle wildcards, it will not cross directories.
Reply With Quote
  #5  
Old 04-15-2007
reborg's Avatar
Administrator
 

Join Date: Mar 2005
Location: Ireland
Posts: 3,590
Quote:
Originally Posted by Knotty
So you're saying that if a directory(folder) is holding say 50 files in say ten sub-directories then the only option to transfer these files onto a local machine is to go into each sub-directory and transfer them from there?
Yes, that is exactly what I am saying. You could get more creative a write a coprocess script in ksh to mimic what you want be creating the directories when needed, I think Perderabo even posted such a script here ( serach for recursive ftp ). Some ftp clients also do this.

If you have expect installed, have a look at the rftp example that comes with expect. You'll find it in the same directory as the expect binary.
Reply With Quote
  #6  
Old 04-15-2007
Registered User
 

Join Date: Mar 2007
Posts: 11
Thumbs up

Thanks reborg and AWK for your replies. I did not know about tar. This does the trick for me. I gathered them together with tar and zipped them up with gzip. Transfered without any fuss.

Everyday ye learn somthing knew eh!
Cheers again
Reply With Quote
  #7  
Old 04-23-2007
Registered User
 

Join Date: Mar 2007
Posts: 17
Smile ftp on solaris 10

Hi guys,

Since we are talking about ftp. I am trying to set up an ftp guest account on solaris 10. The account can not "cd .." out of the directory but only when the user is part of the guest group. Thats works fine but, The ftp client cann't see any files because the command "dir" doesn't work once the users is in the guest group. whoever the command "ls" does work.

Any ideas.

thanks
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:09 PM.


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