[TriLUG] copying files

Matt Pusateri mpusateri at wickedtrails.com
Tue Jun 19 23:24:07 EDT 2012


As another alternative, which depending on it's algorithm, may be faster on subsequent runs is Unison.  http://www.cis.upenn.edu/~bcpierce/unison/  It's designed for synchronization, but you may be able to get it to to make it unidirectional. 

Matt P.

On Jun 19, 2012, at 8:00 PM, Joseph Mack NA3T wrote:

> I want to copy all the new files in a directory to a back up directory on a remote machine (nfs mounted)
> 
> local machine has
> 
> /local_dir/directory_to_be_backed_up/
> 
> cd /local_dir
> cp -auv directory_to_be_backed_up $remote_dir
> 
> this works fine except that the directory to be backed up has 10,000 files in it, at arbitary and varied depths, and the link to the remote machine is slow. The copy has to compare the dates of 10,000 files over a slow link for just one copy. It turns out that the comparison takes all the time.
> 
> However the files are updated exactly every 5 mins so I can quickly find the new files locally
> 
> cd /local_dir
> find ./ -mmin -5 -type f | xargs
> 
> Now I only need to copy my short list of new files, one of which might be
> 
> file="./foo/bar/baz"
> 
> (where the depth varies for each file)
> 
> but now if I do
> 
> cp -auv $file $remote_dir
> 
> I get $remote_dir/baz
> 
> but I want
> 
> $remote_dir/foo/bar/baz
> 
> Anyone know how to copy a file and the directory structure it's sitting in?
> 
> Thanks Joe
> -- 
> Joseph Mack NA3T EME(B,D), FM05lw North Carolina
> jmack (at) wm7d (dot) net - azimuthal equidistant map
> generator at http://www.wm7d.net/azproj.shtml
> Homepage http://www.austintek.com/ It's GNU/Linux!
> -- 
> This message was sent to: M. Pusateri <mpusateri at wickedtrails.com>
> To unsubscribe, send a blank message to trilug-leave at trilug.org from that address.
> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> Unsubscribe or edit options on the web	: http://www.trilug.org/mailman/options/trilug/mpusateri%40wickedtrails.com
> TriLUG FAQ          : http://www.trilug.org/wiki/Frequently_Asked_Questions




More information about the TriLUG mailing list