[TriLUG] copying files

Jeff Schornick jeff at schornick.org
Tue Jun 19 21:22:18 EDT 2012


On Tue, Jun 19, 2012 at 8:00 PM, Joseph Mack NA3T <jmack at wm7d.net> wrote:
> I want to copy all the new files in a directory to a back up directory on a
> remote machine (nfs mounted)

If you skip NFS and use rsync via SSH, it'll construct both file lists
locally instead of over NFS (which is slow).  The rsync algorithm to
diff these lists is very efficient.

However, to avoid the remote compare entirely, you probably just want
find + cpio (in copy-pass mode).  Example:

$ find . -mtime -5 -type f -print0 | cpio --null -pvd /nfsdir/

The "-d" flag of cpio does your directory creation.  If you don't like
cpio, you could coax tar into doing something similar, I imagine.

  - Jeff



More information about the TriLUG mailing list