With a little side of applesauce...

Monday, January 29, 2007

Using tar to move file trees across the network

I got this great tip from:

http://www.cs.hmc.edu/qref/targzip.html

You can also use a tar pipe to copy across the network:

% (cd /src; tar -cvf - foo) | (ssh other.machine ‘cd /dst; tar -xf -’)

I used it to move all files that were newer than 07 Jul 2006:

(tar -cvf - -N “07 Jul 2006″ myweb/*) | (ssh remoteserver ‘cd /webroot/; tar xf -’)
Cool!

No comments: