Cron job can't access Documents - "Tar: Desktop: Couldn't visit directory: Unknown error: -1"
0
votes
2
answers
1391
views
I have an automated backup script that runs from a cron job. It basically tars up my home directory and pipes it to a command that writes the tarball to Amazon S3.
tar zcvf - -X BACKUP_EXCLUDE | /usr/local/bin/aws s3 cp - ...
It works fine if I run from the command line, but from a cron job it fails with:
tar: /Users/falk/Desktop: Couldn't visit directory: Unknown error: -1
tar: Error exit delayed from previous errors.
I'm guessing this is some sort of security thing, likely "Full Disk Access". (Adding Desktop to my "BACKUP_EXCLUDE" file didn't seem to help.)
Is there a way to whitelist tar to access all my files from cron? Or give cron jobs the same access as the same command executed from the terminal?
Asked by Edward Falk
(1083 rep)
Nov 27, 2021, 08:10 AM
Last activity: Nov 27, 2021, 07:53 PM
Last activity: Nov 27, 2021, 07:53 PM