ftp help
Category: UNIX-Unix Beginner
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?
it has nothing to do with permissions. transfer of directories is simply not supported.
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?
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.
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.
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
