![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sudo command not working with cron job. | WhotheWhat | Shell Programming and Scripting | 6 | 12-18-2008 04:10 PM |
| Grep command is not working when put into cron | thiru_cs | Shell Programming and Scripting | 5 | 08-06-2008 05:39 AM |
| formatting textfile inside ksh script using awk not working | tekline | UNIX for Advanced & Expert Users | 6 | 07-03-2007 01:40 AM |
| script not working in CRON | abhijeetkul | Shell Programming and Scripting | 5 | 07-13-2006 05:48 AM |
| looping a array inside inside ssh is not working, pls help | reldb | Shell Programming and Scripting | 5 | 07-07-2006 10:32 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
sudo command is not working inside a script when placed in cron
Hi All,
i have a cron entry like 0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /amex/sssmonitor/dss_chk.ksh and the script is like #!/bin/ksh file=`uname -n` > /sunmast/projects/oasis/COREDEV/Dss$file.log > /tmp/output_sss today=`date` varb=`ps -ef | grep java | grep sss | grep -v grep | wc -l` if [ "$varb" -ne 1 ] then echo "FAILED : SSS processes down, Recycling SSS " >> /sunmast/projects/oasis/COREDEV/Dss$file.log sudo /etc/init.d/init.sss start >> /tmp/output_sss else echo "SSS process is running successfully on `uname -n` on $today " >> /sunmast/projects/oasis/COREDEV/Dss$file.log fi MEMSIZE=`ps -e -o vsz,args | grep /amex/dss/sss/java | grep -v grep | cut -d' ' -f1` echo " Memory usage by dss java client in kilobytes is $MEMSIZE on $today " >> /sunmast/projects/oasis/COREDEV/Dss$file.log when i am manully running this script sudo command inside the script is working,But when the cron is executing the sudo command is not working inside the script. Could anyone let me know what could be the possible reason. I have checked that the cron is executing as other command are running except the sudo command. Please help. Thanks ![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|