How to use prstat within crontab?

Hello, I would like to track the memory usage of a given application over a period of time and I would like to put a crontab which would check the memory utilization every day.

* * */1 * * /usr/bin/prstat -p 8392 >> /tmp/8392

Open in new window


But it does not work as it is interactive.. Kindly help me to put prstat in crontab in Solaris. Thanks!
beer9Asked:
Who is Participating?
 
JackSperowConnect With a Mentor Commented:
Try this..
(date;prstat -s cpu -n 20 -c 1 1) >> a.txt
0
 
arnoldCommented:
/tmp is a bad location to store files you would want to review if the system crashes/reboots.
You should consider using a script that assembles the PIDs of interest to you.

Other items such as vmstat, iostat ps -ef among other parameters might be something you want to collect at the same time.
0
 
woolmilkporcConnect With a Mentor Commented:
prstat should never be "interactive". Maybe the PID does no longer exist?

How about searching "ps" output first to get the correct PID?

wmp
0
 
AmolConnect With a Mentor Commented:
0
 
beer9Author Commented:
Thank you! :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.