[Discuss] rsync v. cp in data migration

Edward Ned Harvey (blu) blu at nedharvey.com
Fri May 24 13:45:42 EDT 2013


> From: discuss-bounces+blu=nedharvey.com at blu.org [mailto:discuss-
> bounces+blu=nedharvey.com at blu.org] On Behalf Of Greg Rundlett
> 
> At this point I've concluded that a
>   cd source; tar cSf - . | ( cd dest; tar xpf - )
> for phase 1 followed by a
>    rsync -avSHP --del source destination
> for the final sync is the way to go.

I don't know if tar offers something rsync doesn't (and I'm not familiar with the "S" option; if using tar for some reason I would personally have done "tar cpf -" and "tar xpf -") ... But I don't see an advantage to running first tar and later rsync.

I would suggest using rsync for both before and after.  That way, you simply paste the same rsync command, and there won't be any introduced possible errors, such as, accidentally forgetting to include the trailing "/" on the source or destination directory, which could accidentally run the later "incremental" send to the wrong subdirectory (or worse, parent directory, thusly re-copying all files and deleting everything you did before.)



More information about the Discuss mailing list