Here are the log files which are currently open:
lsof | fgrep /var/log/httpd/ | awk {'print $9'} | sort | uniq > open.txt
Here are the log files which I intend to move:
ls -l /var/log/httpd/*.[0-9] | awk {'print $9'} | sort | uniq > move.txtNow I compare them and get 100% diff, i.e. no intersections:
$ wc -l move.txt open.txt 241 move.txt 84 open.txt 325 total $ diff move.txt open.txt | wc -l 327 $The extra two lines come from "1,241c1,84" and "---" which diff added. So I'll move the logs:
mv /var/log/httpd/*.[0-9] /root/oldlogs/
No comments:
Post a Comment