The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 02-11-2009
stanleypane stanleypane is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 23
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.