Operating System - HP-UX
1755639 Members
2912 Online
108837 Solutions
New Discussion юеВ

sar in crontab not working

 
SOLVED
Go to solution
dev44
Regular Advisor

sar in crontab not working

I have the following in my crontab, and I have many many sadc processes running but no output. When I simply type "sar", I get that there is no sa02 file. Here is my crontab entry....they folks collecting this data wanted it setup this way to get more data.

0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/lbin/sa/sa1 -A 300 5


They want it running every 5 minutes collecting ALL data.
whatever
7 REPLIES 7
Victor Fridyev
Honored Contributor
Solution

Re: sar in crontab not working

It looks like crontab does not understand parameters. Writa a script with one string
/usr/lbin/sa/sa1 -A 300 5
and run it from crontab
HTH
Entities are not to be multiplied beyond necessity - RTFM

Re: sar in crontab not working

Victor, what are you talking about? of course cron allows you to specify parameters to your commands...

dev44, hHow to use accounting correctly comes up every now and then - it seems you have done only part of the job that needs to be done - look at my post in this thread:

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1276314

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Tingli
Esteemed Contributor

Re: sar in crontab not working

Do you need to run sa2 too?. Go to /var/adm/sa to check whether there is sa1 output, which is sa## over there. Of course you can check sa2 output file sar## over there too.
Ajay Jay
New Member

Re: sar in crontab not working

Hi,

try this

0 * * * * /usr/lib/sa/sa1 300 12 1>/dev/null 2>&1

Regards
Ajay
John Guster
Trusted Contributor

Re: sar in crontab not working

make sure /var/adm/sa is there, if not, create it.
Emil Velez
Honored Contributor

Re: sar in crontab not working

mkdir /var/adm/sa


do a man sa1

It will list the 6 entries for the crontab. I usually copy those 6 entries and they always work.
dev44
Regular Advisor

Re: sar in crontab not working

It didn't like the "-A". That can only be used with sa2 not sa1
whatever