I have a script that runs diskutil and since diskutil needs permissions to run I'm running the script from the root's crontab.
Steps:
- sudo su root
- crontab -e
- sh /test.sh
Nothing ever happens
After typing sudo su root, typing sh /test.sh successfully runs the script.
Any ideas?
test.sh
stored?cron
(you should be usinglaunchd
, BTW). Also, you should be using the full path totest.sh
because root doesn’t inherit your path.mail
from the command line - very different. Also, how are you even putting files in the root folder? By default, macOS doesn’t let you write there, much less execute from there. I think there’s a lot missing from the Q.