Under macOS prior to Catalina I had a LaunchAgent that ran a shell script daily. After upgrading and switching to zsh it doesn't work. Things I've checked:
- shebang switched to zsh
- shell script can be executed manually from command line
- sh has full disk access under System Preferences > Security & Privacy
- plist is in
~/Library/LaunchAgentsand starts automatically, so chown is OK
I added an error check to my plist:
<key>StandardOutPath</key>
<string>/path/to/file.out</string>
<key>StandardErrorPath</key>
<string>/path/to/file.err</string>
and this gives file.err that reads
zsh: can't open input file: /path/to/script.sh
file.out is empty. My script has permissions -rwxr-xr-x
What am I missing?
After suggestions from TheDarkKnight, I added full disk access for zsh - no success. Solution was to switch the shebang back to /bin/bash and gave Full Disk Access to bash. The script now runs fine.