I normally download a directory recursively using:
scp -r <name>@host:<path> .
This has worked fine. As everyone knows this will download all of the directory named in <path> and all of the sub directories.
I would like to know if it is possible to not download a particular file if it is in any part of the directory tree.
I would like to do this because there is a file in every subdirectory that contains a file (always the same name) which I do not need because it is very large, binary, and not very useful for me. So I would like to essentially skip this file and not waste time downloading it because there may be 100's of directories.
If this is not possible with scp, does anyone know how I might accomplish this requirement?
With scp alone, probably not. But you can try this ugly little thing
It's even possible to pipe it through compress/gzip/bzip on both sides as to save on bandwith.
With scp alone, probably not. But you can try this ugly little thing
It's even possible to pipe it through compress/gzip/bzip on both sides as to save on bandwith.
Thanks for the input. I have tested the command and this it what it does.
It downloads all directories (e.g.,/dir1/dir2/dir3/dirofinterest), it does not download any of the files in dir1 dir2 or dir3 which is good.
However, in dirofinterest there are more (around 40) directories which contain a commonly named file Ill call (LEAVE) which I would like to exclude because I do not need them and they are usually at least 20MB.
This is what I typed:
Since I am new it is possible that I misinterpreted your instructions. let me know what you think.
I use this all the time, this is even gzipped (compressed for faster transfer).
Note:
If you are familiar with the tar command then you know that if you start at say "/" and tar the path "/var/www/html" then when you un-tar you will have the full path in that tar file (/var/www/html). If you wish to avoid this, the cd to "/var/www/html" and "tar ./*" so that you do NOT have full path recursion.
Last edited by ddreggors; 02-07-2009 at 04:40 AM..
How to copy multiple directories using single command on solaris 10 from server A to server B.
I tried scp but its working only one directory at atime
How to acheive this with simple and short solution????? (6 Replies)
Hi,
I am trying to do scp from server A to server B. But while doing the scp i am getting the following message.
+-----------------------------------------------------------------+
| This system is for the use of authorized users only. |
| Individuals using this computer system... (6 Replies)
Hi All,
Please help on the below command
scp -r 'directory name'inrvgo@IP:/export/home/muthu/prod_12-09-2010
I am trying to copy a directory from one server to another server using the above command but its displaing the error
(missing destination file) but the diectory was there in the... (1 Reply)
1. how to move files in a directory using scp ?
2. how to move the entire directory ?
3. Will the file and the directory permissions affect scp usage? (1 Reply)
Hi Friends,
I am trying to copy some files over the network in between my linux servers. I am using scp command for this. by default direct ssh root login is disabled on all of my linux servers. Normaly we used to login as a normal user and the su to th root user.
unfortunately root user is... (1 Reply)
hi all
in my script i was using the "scp" command to copy 2 files from a certain directory on server A to the same directory on another server B, but for some reason its only copying the first file in the directory. This is the frst time that i used the scp command,any ideas appreciated.
thnks (5 Replies)
Hi all,
i have a directory in server A. the directory path is /home/kevin. I need to scp the directory to another server B. i would like to ask, when i do a scp of the /home/kevin , i can expect all the files from A to go B. However, how about the hidden files? for example the ssh keys in the... (4 Replies)
I am trying to transfer a 10g files using scp, but I am getting timeout errors is there anywhere that I can modify a config file or something to increase the time. (4 Replies)