|
It's probably got something to do with the way you have sudo setup to handle passwords. There are a variety of options:
1. sudo will always ask for a password.
2. sudo will only ask the first time it's run
3. sudo will require no password
I'm willing to bet that your script works in your shell because sudo is set to only prompt for a password the first time. When cron calls the script, it is probably hanging waiting on a password to be entered.
I'd look at your /etc/sudoers file to see how you're setup.
Or, you could just put this job into the root crontab and not worry about sudo at all.
|