How to 'rsync' from one computer to another

Eric Shubert ejs at shubes.net
Wed Feb 3 13:55:28 MST 2010


joe at actionline.com wrote:
> What is the procedure and syntax to 'rsync' all of a specific set of
> directories and files from one computer to another that are on the same
> network?
> 
> I have been burning DVDs on one computer and copying those files onto my
> other computer(s), but when I download all those files, the permissions
> are all changed to be non-writeable files and directories.
> 
> -r--r--r--  1 root root   9598 Feb  2 15:18 filenames
> dr-xr-xr-x  5 root root   6144 Feb  2 21:06 directory-names

The files are not writable on the DVD, so when the DVD is copied to the 
HD, they remain not writable.

> Is there some way to globally fix that?

The chmod command has an -R option. Otherwise, normal file name pattern 
matching applies.

> Or would 'rsync' be a better solution?
> 
> I've never used 'rsync' and after reading the 'man' pages, I'm still
> confused.

There are examples in the rsync man page. What specifically do you not 
understand?

We can't really give you the command you'd need to use without knowing 
more specifics about the set of directories and machines (ip addresses?) 
you're dealing with.

> Is there a way to do this to preserve the file dates

There is a -p flag for the cp and scp commands which does this.

> and only copy those
> files that are newer (have more recent dates) onto the target system?

You'll need to use rsync for this part.

-- 
-Eric 'shubes'



More information about the PLUG-discuss mailing list