[PLUG] Script Question

Russ Johnson russj at dimstar.net
Wed Oct 13 13:15:02 UTC 2004


R Haack wrote:

> I have a shell script that I created that runs a couple of Linux
>
> commands.  The problem I'm having is that I can run it from the 
> command prompt and it works exactly as I expected, but when I run it 
> from a cron job only one of the two commands run, the last one.  Any 
> ideas on what I can check to make this work? 

Change your "shebang" line from:

#!/bin/sh

to

#!/bin/sh -x

That will cause the output to be much more verbose, and you may see the 
problem.

I'm assuming, of course, that you are getting an email with the output 
from your command.

What I'm suspecting is that your getting a "command not found" error. 
You may be able to fix this easily by specifying the path to the command 
you are using.

Russ




More information about the PLUG mailing list