[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to use prstat within crontab?

Posted on 2011-02-17
5
Medium Priority
?
1,226 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 80

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

649 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