rsync insists on including 'Library' in Mac OS

197 Views Asked by At

I'm on MAC OS Ventura 13.1. I created the following filter file for rsync, and saved it as rsync_filter.conf.

+ */
+ Documents/***
+ Music/***
+ Pictures/***
+ Work/***
- *

Then, I call

rsync -avm --delete --filter="merge rsync_filter.conf" /Users/Me /Volumes/Backup

It does backup the directories I specified, but it also syncs /Users/Me/Library, complaining about denied permissions while doing so. I does not sync any other directories, but content of Library appears in the backup.

What is so special about Library and how do I stop it from syncing? Even including - Library/* in the filter file doesn't help.

1

There are 1 best solutions below

0
On

I found out what was going on. The only files copied from Library contained either Documents or Pictures in their pathway. I preceded my selection of folders in the filter file with my username (e.g. + Me/Documents/*** and it solved the problem.

rsync still tries to access Library which leads to an warning

building file list ... rsync: opendir "/Users/Me/Library/NGL" failed: Permission denied (13)

but apart from this it works fine.