LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Copying directory trees

[ILUG] Copying directory trees

Rick Moen rick at linuxmafia.com
Wed Jan 28 16:38:55 GMT 2004


Quoting kevin lyda (kevin+dated+1075720340.909fca at ie.suberic.net):

> yes, rsync is a nice way to add "continue where you left off" on large
> copies via ssh.  my only complaint about rsync is i don't use it enough
> to remember the flags.  but that's my problem, not rsync's.

It's enough to remember this recipe:

# rsync -avz source destination
         |||
         ||- gZipped
         |- verbose
         - archive (preserve all possible attributes)

(You would omit that "z" when doing intra-host copying.)

Additional flag "-x" means the same is for GNU cp:  Don't cross
filesystem boundaries, e.g., don't accidentally copy /proc when you're
copying at the root directory level.

The nice thing is that if you're in the habit of typing "cp -ax", the
same flags apply for rsync.

The syntax generalises further, using SSH-like username and hostname
specifiers to embrace inter-host copying, e.g., 
# rsync -avz olddirectory username at newhost:newdirectory , but that
needn't be committed to memory.  (If you're going to do that with any
frequency, you might as well add "RSYNC_RSH=/usr/bin/ssh" to your shell
startup, since otherwise rsync will use rsh for network transport.)

-- 
Cheers,                   The cynics among us might say:   "We laugh, 
Rick Moen                 monkeyboys -- Linux IS the mainstream UNIX now!
rick at linuxmafia.com       MuaHaHaHa!" but that would be rude. -- Jim Dennis



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell