Skip to content

Instantly share code, notes, and snippets.

@ethanfu
Created October 29, 2013 08:57
Show Gist options
  • Save ethanfu/7211197 to your computer and use it in GitHub Desktop.
Save ethanfu/7211197 to your computer and use it in GitHub Desktop.
vmstat监控cpu信息,每隔10s一次记录日志,日志每天一个
function eg {
while read line
do
printf "$line"
date '+ %m-%d-%Y %H:%M:%S'
done
}
vmstat 10 | eg >> vmstat_`date +%y%m%d`.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment