12-28-2000 09:13 AM
12-28-2000 09:23 AM
cp /var/adm/syslog/syslog.log syslog.$dt
or maybe mv, but I always prefer to copy rather than move.
You would then put an entry in your crontab to run it once a week, on the day of the week and time of the day to be run. For example, to run it on Sundays at 2am --
0 2 * * 0 filenamewithpathname > /dev/null 2>&1
12-28-2000 11:54 PM
Maureens solution is good, but on reboot or when you restart syslog deamon syslog.log will move to syslog.old. If you want to have syslog.log in Maureens format you should put an entry in /sbin/init.d/syslogd
and change the line
mv /var/adm/syslog/syslog.log /var/adm/syslog/OLDsyslog.log
mv /var/adm/syslog/syslog.log /var/adm/syslog/syslog.$dt
12-29-2000 02:04 AM
After mv syslog.log file you must restart syslogd daemon.
Syslogd will keep on writing on your syslog.log moved file because dont close his file descriptor.
So send HUP signal to syslogd PID to force reconfiguration of syslogd.
kill -HUP `cat /var/run/syslog.pid`
See man syslogd
01-02-2001 03:20 AM
/sbin/rc3.d/Sxxxcopy_syslog -> /sbin/init.d/copy_syslog
/sbin/rc2.d/Kxxxcopy_syslog -> /sbin/init.d/copy_syslog .
The script copy_syslog in the stop section will have:
cat /var/adm/syslog/syslog.log | grep -v bootpd | grep -v repeated > DIR/syslog.`date +%y%m%d `