You're killing me here.
Code:
ssh -ql <user> <source:directory> -name "*.pdf" -exec scp '{}'<user>@destination:directory>\;
Now, I'm presently sitting at an OS X 10.5 box. I have no idea even what shell you're running, let alone the version of ssh you have.
My ssh man page says:
-q is quiet mode
-l <user> would be the login
Everything after this looks like it was supposed to be part of a find command! Here's the problem: the -exec option sucks. Use -print0 and xargs -0. (This basically directs find to spit out a null-delimited list of files, and the -0 option to xargs directs it to expect a null-delimited list of files.)
Further, are you copying a bunch of stuff back to your computer? Rather than making new connections via scp, just send yourself a tarball.
Assuming you're using some sh derivative (e.g. bash), I'd suggest:
Code:
ssh user@some.remotehost.com 'find /source/dir -name "*.pdf" -print0 | xargs -0 tar -cO' | tar -xivf - -C /destination/dir
For tar: the -i option is uncommon, but basically xargs will call tar repeatedly and the data streams will be jammed together. Each time tar is done, it will leave an "I'm done!" marker, which would normally tell the decoding tar to stop. The -i option tells it to ignore this and keep reading.
This sounds flaky, I know, but it's very similar to the situation you had with magnetic tapes, which is what tar was specifically designed for.
For xargs: you can control how many times tar is called with the -n option for xargs. The default is every 5000 files, which should be fine.
If you need to connect to a third computer, you can still use scp:
Code:
ssh user@some.remotehost.com 'find /source/dir -name "*.pdf" -print0 | xargs -0 -J % scp % user@another.host.com:/dest/dir'
The -J % option tells xargs to put the list of files in where it sees %.