Skip to content

Instantly share code, notes, and snippets.

@sprite2005
Created May 20, 2010 19:51
Show Gist options
  • Save sprite2005/407996 to your computer and use it in GitHub Desktop.
Save sprite2005/407996 to your computer and use it in GitHub Desktop.
ip-10-251-97-220 etc # netstat -tn | grep 5038
tcp 0 0 127.0.0.1:57929 127.0.0.1:5038 ESTABLISHED
tcp 0 0 127.0.0.1:57928 127.0.0.1:5038 ESTABLISHED
tcp 0 0 127.0.0.1:5038 127.0.0.1:57929 ESTABLISHED
tcp 0 0 127.0.0.1:5038 127.0.0.1:57928 ESTABLISHED
ip-10-251-97-220 etc # cd cron.daily
ip-10-251-97-220 cron.daily # ls
logrotate.cron makewhatis syslog.cron
ip-10-251-97-220 cron.daily # nano -w syslog.cron
ip-10-251-97-220 cron.daily # ./syslog.cron
ip-10-251-97-220 cron.daily # netstat -tn | grep 5038
tcp 0 0 127.0.0.1:57929 127.0.0.1:5038 CLOSE_WAIT
tcp 0 0 127.0.0.1:57928 127.0.0.1:5038 CLOSE_WAIT
tcp 0 0 127.0.0.1:5038 127.0.0.1:57929 FIN_WAIT2
tcp 0 0 127.0.0.1:5038 127.0.0.1:57928 FIN_WAIT2
-------------------------------------------
syslog.cron
#! /bin/sh
# sysklogd Cron script to rotate system log files daily.
#
# If you want to rotate other logfiles daily, edit
# this script. An easy way is to add them manually
# or to add -a to syslogd-listfiles and add some grep
# stuff
#
# Written by Martin Schulze <joey@debian.org>.
# $Id: syslog-cron,v 1.6 2007/07/13 10:31:25 uberlord Exp $
cd /var/log
logs=$(syslogd-listfiles)
for LOG in $logs
do
if [ -s $LOG ]; then
savelog -g adm -m 640 -u root -c 7 $LOG >/dev/null
fi
done
# Restart syslogd
#
/etc/init.d/sysklogd restart > /dev/null
@wwalker
Copy link

wwalker commented May 20, 2010

gentoo rocks! ... the boat over...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment