Linux Recipes / Ricette Linux

howto copy 40Gb large directory and live happy?

there are a lot of way to do so. First thing we have to know if the source directory and the destination are on the same machine.

source and dest on same machine:

cd source ; tar -c * | (cd dest; tar -xf - )

note: this way to copy files. will maintain date, and the attributes of files…

you can use rsync too:

rsync -av source dest

really simple…

a litte more complex way:

rsync -Pavzh --log-file=~/copy.txt source dest

and what if source and destination are not on the same machine ?
(we will assume that both machine are on the same network, and we have ssh access on both)

tar cf - source | ssh user@remote_host tar xf - -C dest


rsync -avz user@remote_host:/source_dir/* ./dest_dir/

Comments are closed.