5 Replies Latest reply: Jul 16, 2014 5:38 PM by Tony T1
Matteo_999 Level 1 Level 1



in rsync what syntax should I use to sync or not sync the icon from the source folder to the target folder?

I'll explain: I want different rsync codes:

1. sync from a folder to another one all files, including the icon, tags, arrangement of the files.

2. sync from a folder to another one all files, excluding the icon of the folders, but including tags, arrangement of files.

3. sync from a folder to another one all files, excluding icon of the folder, tags and arrangement.


And in addition to that i was wondering if there is a way to not create that empty file named Icon.


Thanks in advance.

Reply by Mark Jalbert on Jul 16, 2014 9:49 AM Helpful

Have you read the manual?


1) If you are using the Apple provided rsync then use the -avE options

2) add --exclude=Icon?

3) add--exclude=Icon? --exclude=.DS_Store remove the E option


create an empty Icon? file->

touch Icon?

Reply by Mark Jalbert on Jul 16, 2014 11:33 AM Helpful

In the second case, namely sync from the first folder all except to the icon of the principal folder, but including icons....

That is not what you originally asked for. You need to read the manual. If you want the principal folder copied to the destination folder then you need to leave off the trailing "/" from both path arguments. The following is untested, use at your own risk, but should do what you are asking for now.

rsync -avE --exclude="$1/Icon?" "$1" "$2"

All replies