Log file rotation and cookie viewing
Posted in Server Updates on February 25th, 2006alright not that any of you care - unless theres some unknown geeks out there reading this…. but I got into the whole bash script thing and wrote one that archives the HoTTProxy logs every tuesday. I might change that to every other tuesday or something. It moves the log file to the archive folder with the date on the end, and then ‘touch’s a new log file. then to make sure it writes to the log, it restarts the HoTTProxy service. I’m not sure this is absolutely necessary, but I know the process works if I do. Otherwise, it wouldn’t write anything to the log file, even after i ‘touch’ed it.
Here’s the script, incase you want it:
#!/bin/bash
#
# Jonathon Reinhart 2-25-2006
# Archives HoTTProxy logs
#
mv /etc/HoTTProxy/HoTTProxyLog.txt /etc/HoTTProxy/log-archive/HoTTProxyLog_`date +%F`.txt
touch /etc/HoTTProxy/HoTTProxyLog.txt
/etc/init.d/HoTTProxy restart