Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Am getting the real-time memory stats from vmstat command. I did this using following steps:

$ nohup vmstat 60 > &

the command executes in background and writes the log to the file When i see use the command

$ ps -A | grep stat

I could see the vmstat running in the background and i could also access the log using tail command as:

$ tail -f

the file updates every 60sec interval.

Now my question is :process continues to write to the file so what will happen if i leave for days ?

Assumption: If the process writes the file forever am afraid that the file size might grow too large

If my assumption is correct and my steps are inefficient. Is there any alternatives to achieve what am trying to achieve from my above steps ?

Already Asked it Here

share|improve this question
why not use sysstat(sar)? – c4f4t0r Mar 15 '14 at 9:13
I would also suggest ot use dedicated software like atop, sysstat, mrtg(snmp), or proprietary solutions. – mveroone Mar 15 '14 at 10:48

Using vmstat to build this sort of thing is possible, but you will get a lot more results for our effort by configuring something like munin or cacti. All of the stats you are getting from vmstat plus iostat plus more will get turned into pretty graphs. Munin and other similar tools use RRD to avoid having data fill up your drive.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.