Tip #492 Moving large directories
Why not use cp or mv to move /usr/home to /storage/export/home? Weird things happen to hard and softlinks when you mv or cp. Try it and remember that a mv between different filesystems is actually a copy and delete.Try this instead:
# tar -C /usr -cf - home | tar -C /storage/export -xvf -
Or, to copy to a remote machine:
# tar -C /usr -cf - home | ssh user@somemachine tar -C /storage/export -xvf -
You may want to add the -z switch to the tar commands. It will add compression but it depends on the type of data and your connection speed if it really improves transfer speeds.
- TAGS:
- tar
alias aptitude at awk bash bc cal cat cd colrm comm cp csh curl cut date dd df dialog diff dirname dpkg du fc find fuser grep gs gzip history iconv kill ksh last less ln ls lsof lynx m4 md5sum mkdir mkfifo mkisofs mv mysql nc netstat openssl OSX perl ping popd ps pushd python read redirection rm scp screen sed sort ssh stat sudo svn tail tar tee test top tr uniq vim wc wget xargs