Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Rsync include/exclude icon

Hello,


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.

Posted on Jul 16, 2014 8:49 AM

Reply
Question marked as Best reply

Posted on Jul 16, 2014 9:49 AM

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?
5 replies

Jul 16, 2014 11:33 AM in response to Matteo_999

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"

Rsync include/exclude icon

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.