?
Solved

How to use prstat within crontab?

Posted on 2011-02-17
5
Medium Priority
?
1,219 Views
Last Modified: 2013-12-27
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!
0
Comment
Question by:beer9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 1

Accepted Solution

by:
JackSperow earned 668 total points
ID: 34919260
Try this..
(date;prstat -s cpu -n 20 -c 1 1) >> a.txt
0
 
LVL 79

Expert Comment

by:arnold
ID: 34919774
/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
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 668 total points
ID: 34924109
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
 
LVL 9

Assisted Solution

by:Amol
Amol earned 664 total points
ID: 34925483
0
 

Author Closing Comment

by:beer9
ID: 34960842
Thank you! :-)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question