chown doesn't work in cron
so here is what i did to debug this situation. i have a script called myscript.sh that contains the following lines:
#!/bin/sh
logpath="/Library/Logs/ssh_fix.log"
if [ `id -u` -ne 0 ]; then
echo "Error: Not super user." >> "$logpath"
echo `date`": Exit script, status 1." >> "$logpath"
exit 1
fi
chown -v root:wheel ~/Desktop/test.txt
echo `date`": Exit script, status 0" >> "$logpath"
exit 0
the script is set to be executable, and it works fine byitself. but when i put it in the crontab, chown doesn't do a thing. and as you can see, i do a test first to see if the script is run as a super user, which it was.
am i missing something? is there something between chown and cron that don't mix well? i'd appreciate any reply. thanks.
PowerBook G4, Mac OS X (10.5.7)