Skip to content

Instantly share code, notes, and snippets.

@citrin
Last active August 29, 2015 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save citrin/9742337 to your computer and use it in GitHub Desktop.
Save citrin/9742337 to your computer and use it in GitHub Desktop.
#!/bin/sh
dir=`dirname $0`
logfile=$dir/`date +%F`.log
#TOP='top -jabtS -d1 -ores 1024'
TOP='top -d1 -Unobody -abtSH 128'
date +'%F %T' >> $logfile
$TOP >> $logfile
echo ------------------------------------------------------------------------------- >> $logfile
find $dir -name '????-??-??.log' -mtime +2 -exec gzip {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment