The UNIX and Linux Forums  

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



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
Execution on cron does not work well msetjadi Shell Programming and Scripting 7 06-03-2009 09:38 PM
Cron execution of shell script ashish.sharma Shell Programming and Scripting 3 09-08-2008 03:57 AM
cron execution rameek20 SUN Solaris 6 10-22-2007 06:30 AM
Sequential execution of job in cron pankajkrmishra Shell Programming and Scripting 3 08-15-2006 06:19 AM
Cron Skips Execution nag_sundaram HP-UX 6 10-25-2005 03:46 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-15-2009
lost_neko lost_neko is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 2
Unhappy script execution differs in cron

I have the following script (MyScript):

#!/bin/sh
ps U erv | grep -v grep | grep -F "/usr/bin/collect -o 101"
echo "Result: $?"

When executed from the command line, I get
... (the line containing /usr/bin/collect -o 101)
Result: 0
(which is correct since collect is running)

When I put the script in cron with:
*/10 * * * * ./MyScript >>log.log

in log.log I get
Result: 1

What is wrong?
I tried to put the complete path for ps and grep, but I had the same result.
Could be because the command displayed by ps is truncated? How can I display it all?

Please help!
 

Bookmarks

Tags
shell script cron

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:42 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0