Backup problem on macOS Catalina

Trying to finally experience restic but I can not even get it to work. This time I have a problem with backup itself, I’m getting error: “operation not permitted”.

I’ve been reading that macos had problem with full disk access so I started following different solutions. ie. i wrote this c wrapper to execute shell command and added c bin to macos full disk access whitelist.

#include <stdlib.h>
int main(){
    system("RESTIC_PASSWORD='test123' /usr/local/bin/restic -r /Volumes/music-store/restic-test backup /Volumes/ExFa007/all/__gpg_kyes");
    return 0;
}

I execute my program with sudo otherwise I get different error: “permission denied”

Thx for help in advance.