Fixing backups in MacOS Mojave/Catalina (Error: Operation not permitted)

Are you certain you need to back up the folders it’s denying access to?

The easy way is to avoid protected directories.

macOS is, roughly, putting an extra permission layer between apps/scripts and some kinds of sensitive user/system data. The goal is generally to notify you that a particular application is trying to access a type of data, and obtain affirmative consent for each app that wants access. I think it’s fair-ish to frame this as baby steps towards a more mobile-OS like permission system, where you’d get prompted if an app wanted to access your photos directory, and then again if it wanted to access your contacts. But, it also has rough edges (like cases where the user isn’t automatically prompted to give consent, and you have to go fishing).

If your goal is just backing up important user files, I’d dig into these and make sure you actually need what’s in them–and, if you do, that you know exactly which ones. (I don’t mean this to be dismissive; I don’t have a direct answer to the question myself, because my backups target directories where I store personal files and I haven’t needed to exempt restic from any of the security & privacy restrictions.)