Joe Harrington
2002-Feb-20 18:37 UTC
feature request: add -a to scp for archive-style copy
This is a feature request for scp. scp has no easy option to copy symlinks, etc. to reproduce a directory tree. The -r option follows symlinks and reads the data out of device files when copying. A few years ago, the -a option was added to normal cp, replacing the cumbersome and arcane (cd wherever1 ; tar cf - whatever) | (cd wherever2 ; tar xpf - ) with cp -a wherever1/whatever wherever2 Adding a -a option to scp would likewise eliminate the need for the even more obscure but frequently-typed ssh wherever1 -l whoever "(cd wherever2 ; tar cf - whatever)" | (cd wherever3 ; tar xpf - ) Instead, it would be scp -a whoever at wherever1:wherever2/whatever wherever3 (cpio fans can make the appropriate replacements). The -a feature doesn't exist under Red Hat's openssh-2.9p2-12, and I can't find release notes for any more recent version on openssh.org. If it has been discussed or (!) implemented in 3.0.X, thanks! --jh--
On Wed, 20 Feb 2002, Joe Harrington wrote:> This is a feature request for scp. scp has no easy option to copy > symlinks, etc. to reproduce a directory tree. The -r option follows > symlinks and reads the data out of device files when copying. A few > years ago, the -a option was added to normal cp, replacing the > cumbersome and arcane > > (cd wherever1 ; tar cf - whatever) | (cd wherever2 ; tar xpf - ) > > with > > cp -a wherever1/whatever wherever2 > > Adding a -a option to scp would likewise eliminate the need for the > even more obscure but frequently-typedI like this personally, but I doubt main OpenSSH people agree.. partially because BSD make doesn't support 'cp -a'. -- Pekka Savola "Tell me of difficulties surmounted, Netcore Oy not those you stumble over and fall" Systems. Networks. Security. -- Robert Jordan: A Crown of Swords
Circa 2002-Feb-20 13:37:06 -0500 dixit Joe Harrington: : This is a feature request for scp. scp has no easy option to copy : symlinks, etc. to reproduce a directory tree. The -r option follows : symlinks and reads the data out of device files when copying. A few : years ago, the -a option was added to normal cp, replacing the : cumbersome and arcane [...] 'cp -a', to my knowledge, only works with the cp from GNU fileutils. I recommend using 'rsync -a'---it does exactly what you ask. In fact, i recommend using rsync instead of scp for almost all cases, in particular because it avoids potential problems with SSHv1/SSHv2 compatibility when one of the client/server pair is OpenSSH and the other is SSH.com's. -- jim knoble | jmknoble at pobox.com | http://www.pobox.com/~jmknoble/