Solved

How to use prstat within crontab?

Posted on 2011-02-17
5
1,202 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 167 total points
ID: 34919260
Try this..
(date;prstat -s cpu -n 20 -c 1 1) >> a.txt
0
 
LVL 78

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 167 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:amolg
amolg earned 166 total points
ID: 34925483
0
 

Author Closing Comment

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

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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 get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

695 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