09 July 2006

Copy directories over ssh

cd /somedir/somesubdir && tar cpzf - * | ssh somehost "cd /somedir/somesubdir && tar xpzf -"

or

ssh somehost "cd /somedir/somesubdir && tar cpzf - *" | (cd /somedir/somesubdir && tar xpzf -)