title: sudo password automation is not working as expected when executing from crontab?
body: <p>I have a shell script as follows.</p>
  
  <p>abc.sh</p>
  
  <pre><code>echo "Password" | sudo -S /etc/init.d/mysqld status
  </code></pre>
  
  <p>It is working fine when I am executing directly from shell. My problem comes into picture when I am trying to execute the same as <strong>cron (crontab)</strong>, it is not working. sudo -S options is not working well with crontab. Is there any other option to specify sudo password in shell script(automation)</p>
  
  <p>I could try modifing the /etc/sudoers file by adding NOPASSWD option, if I have root access. But unfortunately I dont have root access to modify /etc/sudoers file. I have the sudo access only for executing certain commands.</p>