SirDice
December 10th, 2008, 20:38
The things that make *nix famous. Crazy one-liners :e
Couple ones I found quite useful:
# tar -C /usr -cf - home | tar -C /storage/export -xvf -
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.
A little variation on the theme:
# tar -C /usr -cf - home | ssh user@somemachine tar -C /storage/export -xvf -
But user@somemachine must have write access of course, so sometimes it's easier to pull instead of push:
# ssh user@somemachine tar -C /usr -cf - home | 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.
Couple ones I found quite useful:
# tar -C /usr -cf - home | tar -C /storage/export -xvf -
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.
A little variation on the theme:
# tar -C /usr -cf - home | ssh user@somemachine tar -C /storage/export -xvf -
But user@somemachine must have write access of course, so sometimes it's easier to pull instead of push:
# ssh user@somemachine tar -C /usr -cf - home | 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.