2

I'd like to copy manually into ~/Library/Messages to maintain message history.

The folder is owned by the user, not by root:

% ls -al ~/Library | grep Messages
drwx------   11 sam    staff   352 29 Jun 12:11 Messages

and yet I cannot read the contents

% ls -al ~/Library/Messages
total 0
ls: /Users/sam/Library/Messages: Operation not permitted

Even though it's unclear why I should need to sudo, I try anyway

% sudo ls ~/Library/Messages
Password: 
ls: /Users/sam/Library/Messages: Operation not permitted

but that fails as well.

How can I access ~/Library/Messages (on Monterey)?

Update

Now Terminal can access ~/Library.

% ls ~/Library/Messages
Drafts
...
prewarm.db-wal

and I can set aside the existing ~/Library/Messages

% mv ~/Library/Messages ~/Library/Message-set-aside

but I still cannot rsync

rsync -avz /Volumes/bak/sam/Library/Messages  /Users/sam/Library  >> /tmp/messages-log 2>&1

as it yields

building file list ... done
Messages/
rsync: recv_generator: mkdir "/Users/sam/Library/Messages" failed: Operation not permitted (1)
*** Skipping everything below this failed directory ***

Hints?

Sam7919
  • 305
  • 2
  • 11

2 Answers2

2

That folder has special protection enforced by the kernel for sensitive data. You can open the folder by navigating to it in the Finder. Or you can grant full disk access to the Terminal app in the Security and Privacy preference pane.

Linc D.
  • 431
0

macOS (or at least Monterey) will not let the user rsync into ~/Library/Messages.

It will, however, let you rsync into ~/, and from there you can drag the Messages folder into ~/Library.

Sam7919
  • 305
  • 2
  • 11