Snippets

Created by Anton Yuzhaninov last modified
#!/bin/sh

# add to cron
# * * * * * ${HOME}/toplog/top.sh 2>/dev/null

dir=`dirname $0`
logfile=$dir/`date +%F`.log

#TOP='top -d1 -Uroot -abtSH'
TOP='top -d1 -abtSH 100'

date +'%F %T' >> $logfile
$TOP >> $logfile
echo ------------------------------------------------------------------------------- >> $logfile

find $dir -name '????-??-??.log' -mtime +2 -exec gzip {} \;

Comments (0)