General
cancel
Showing results for 
Search instead for 
Did you mean: 

running system info related commands via cron

Kuntal Gupta
Frequent Advisor

running system info related commands via cron

Hi,

I am finding that system information related commands like, machinfo, parstatus etc are not being executed via cron. If in a script these commands are used to extract the system info, and the script is run independently (i.e. not via cron scheduler) the system command are executed and create the out put file with the command o/p. But when the script is put in cron, these commands are just not executed where as other normal command like ioscan etc, netstat etc are executed. Pls suggest...

Kuntal
11 REPLIES
Torsten.
Acclaimed Contributor

Re: running system info related commands via cron

You always need to use the full path to a binary while scripting, did you do that?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Steven Schweda
Honored Contributor

Re: running system info related commands via cron

> You always need to use the full path to a
> binary while scripting, [...]

Really? You can't just set a proper PATH?


> [...] in cron, these commands are just not
> executed [...]

Rather than tell us what did not happen, you
might try to tell us what you actually
observed.
Kuntal Gupta
Frequent Advisor

Re: running system info related commands via cron

Thanks to both of you for your quick reply against my quarry.

e.g Initially 'machinfo | grep -i Memory >> file_name' command was not giving any o/p in the o/p file but after your suggestion I have amended the command to '/usr/contrib/bin/machinfo | grep -i Memory >> file_name' i.e. I have used the full path and it is now working fine.

But for the 'top -s1 -d1' the problem persists even after giving the full path, /usr/bin/top.

Regards...

Kuntal
Steven Schweda
Honored Contributor

Re: running system info related commands via cron

> But for the 'top -s1 -d1' the problem
> persists even after giving the full path,
> /usr/bin/top.

You might try to save the error messages
using something like "2> error_log" on that
command.

As usual, some basic information might be
interesting. For example:

uname -a
/usr/bin/top --version
Kuntal Gupta
Frequent Advisor

Re: running system info related commands via cron

running 11.31 version,
Box-rx8640 with 4 vPars
Dennis Handly
Acclaimed Contributor

Re: running system info related commands via cron

>But for the 'top -s1 -d1' the problem persists even after giving the full path, /usr/bin/top.

If you aren't running top on a terminal, you'll need to use the "-f filename" option to redirect the output.

>SEP: /usr/bin/top --version

Not on HP-UX but you can use what(1).
Kuntal Gupta
Frequent Advisor

Re: running system info related commands via cron

Thanks Mr Steven Schweda,

with -f option it is working fine.

Just I have one quarry, how should I identify the version of any command, say as u have asked for top?

Thanks a lot once again....

Kuntal


Dennis Handly
Acclaimed Contributor

Re: running system info related commands via cron

>how should I identify the version of any command

Most HP-UX commands don't have versions other than the HP-UX version. You may be able to use what(1) to find if they were patched.
Kuntal Gupta
Frequent Advisor

Re: running system info related commands via cron

I have found a solution of my question, my speacial thanks to Mr Steven Schweda.
Dennis Handly
Acclaimed Contributor

Re: running system info related commands via cron

>I have found a solution of my question

If you are happy with the answers you were given, please read the following about how to reopen threads and assign points:
http://forums.itrc.hp.com/service/forums/helptips.do?#41
http://forums.itrc.hp.com/service/forums/helptips.do?#33
Dennis Handly
Acclaimed Contributor

Re: running system info related commands via cron

>>SEP: /usr/bin/top --version

(Sorry about the misattribution, that was Steven.)