Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was under the impression from here among other research, that rsync was the command used to sync directories and any contents they have.

I have tried the following commands:

rsync -avzr ~/testing123 ~/Desktop/apartment
sudo rsync -avzr ~/testing123 ~/Desktop/apartment

Neither of them preserve the icon, they both produce the same result:

sent 544 bytes  received 92 bytes  1272.00 bytes/sec
total size is 6148  speedup is 9.67
building file list ... done
created directory /Users/null/Desktop/apartment
testing123/
testing123/.DS_Store
testing123/Icon\#015
testing123/info.txt

sent 566 bytes  received 92 bytes  1316.00 bytes/sec
total size is 6166  speedup is 9.37

They both sync the files correctly but do not preserve the icon from the original file or directory. For directories, rather than preserving the icon on a folder, both commands create a '0 KB' file in the destination directory called 'Icon' with no extension. For files, it does nothing, no mystery 'Icon' file, and no actual icon.

Is it a matter of me using the wrong arguments? What is the problem here? Why won't rsync actually create the same icons on the destination files as on the source files?

share|improve this question
    
Please make an effort to format your post properly. –  Daniel Beck Feb 3 '12 at 18:32
    
My apologies, what did I not do that I should have done (besides a misspelling in the name that I did not notice until now)? –  FALL3N Feb 4 '12 at 18:51

1 Answer 1

up vote 6 down vote accepted

You need to specify the -E option to rsync.

   -E, --extended-attributes
          Apple specific option  to  copy  extended  attributes,  resource
          forks,  and  ACLs.   Requires at least Mac OS X 10.4 or suitably
          patched rsync.

Icons are stored in HFS+ resource forks.

share|improve this answer
    
thanks! that was the answer! oh, this is not something I need to know in order to do this, but what actually was that file 'Icon' that was 0kb in a directory I was rsyncing? –  FALL3N Feb 4 '12 at 18:49
    
You're welcome. See here for details. –  Daniel Beck Feb 4 '12 at 22:21
1  
Seems to me that this option is abbreviated "-X" in rsync 3.x. -E stands for "executability". –  Kuba Wyrostek May 16 '13 at 10:39

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.