cronjob get permission error for folders
I tried to write a script to clean up some folders e.g. ~/Downloads.
If I run the script in Terminal it works. If I add the script to a "crontab -e" it doesn't.
I wrote a test script to get some information about the environment:
test_cron.sh:
#!/bin/sh
echo "User $(whoami) in $SHELL"
ls ~/Downloads
crontab -e:
17 21 * * * ~/.services/test_cron.sh > ~/.services/cron_test.log 2>&1
cron_test.log:
User tim in /bin/sh
ls: /Users/tim/Downloads: Operation not permitted
Privacy & Security Settings:
I used MacOS 15.1.1
I would be grateful for any help.