[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-developers] perl, cron, and shell commands



On Wed, 21 Jun 2000, Kevin D wrote:

> perl doesn't execute properly. Here is the shell command taken directly from
> the perl script:
> 
> $log = `top -n 1 -b`;
> 
> The $log variable receives the correct info when I run from the command
> line. But when the script runs from crontab, the $log variable doesn't get
> anything. Does anyone know why this is? Below is an example of my crontab
> entry:

When you execute it from the terminal, top know (or thinks) that it is
running on the terminal. When cron executes it, top knows that it is run
as a backup pocess, thus it terminates abnormally.

Sound like for what you need 'uptime' would do the trick.