Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I know you can use -a or --archive to activate archive mode when using rsync. Unfortunately, I have no idea what archive mode is supposed to do, and the man page is not at all explicit about what this is:

equals -rlptgoD (no -H,-A,-X)

Can you explain what those options (rlptgoD) mean and what's the behaviour of rsync when I use them?

share|improve this question
    
We could probably do without all the "reminds me...", which are completely irrelevant. –  John Gardeniers May 14 '10 at 4:46
add comment

3 Answers

It's all of these:

-r, --recursive recurse into directories

-l, --links copy symlinks as symlinks

-p, --perms preserve permissions

-t, --times preserve modification times

-g, --group preserve group

-o, --owner preserve owner (super-user only)

-D same as --devices --specials

--devices preserve device files (super-user only)

--specials preserve special files

It excludes:

-H, --hard-links preserve hard links

-A, --acls preserve ACLs (implies -p)

-X, --xattrs preserve extended attributes

It's perfect for backups. My "default" set of switches is -avzP - archive mode, be verbose, use compression, preserve partial files, display progress.

share|improve this answer
add comment

The archive switch is just a shortcut to skip having to enter a bunch of switches that you'll normally use if you're using rsync to make backups (a common task).

It's the same as typing:

rsync -r -l -p -t -g -o -D

And it's much easier to remember. You can find definitions for all of those switches in the man page.

(The hyphens are optional when you're combining multiple single-letter switches.)

share|improve this answer
1  
thanks, but I think you're missing my point. Can you please explain what combining all those options does without having me read 7 different parts of the man page, which probably refer to other parts of the man page? –  user38334 May 14 '10 at 3:40
10  
I think you're missing the point that it's important to read the man page to know exactly what you're doing. rsync has some very powerful options, including a way to delete files! It's like your asking for help on using a table saw because you don't like reading instruction manuals. –  David M May 14 '10 at 3:53
add comment

It make sure the permission, attributes, etc. is same at the both side. rsync only works in that way... if you want to synchronising files, you have to use -a parameter.

This is because rsync compare these permission, attribute, etc. at both side to determining if they are the SAME FILE and decide if it should be updated. if you use rsync -r xxx yyy instead rsync -a xxx yyy, some files will be copy again and again, coz, permission, attribute not be synchronised, and miss matched at both side...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.