logrotate

for i in cat /proc/vz/veinfo | awk '{print $1}'|egrep -v '^0$'; do echo “Container $i”; vzctl exec $i “grep -i proxmox /etc/motd2 && awk ‘{if (/# rotate log files weekly/) { getline;print $1 };}’ /etc/logrotate.conf | grep weekly && sed ‘/# rotate log files weekly/{n;s/./monthly/}’ /etc/logrotate.conf > /etc/logrotate.tmp && mv -n /etc/logrotate.conf /etc/logrotate.conf.bak && mv -f /etc/logrotate.tmp /etc/logrotate.conf && sed ‘/rotate 4/{s/./rotate 12/}’ /etc/logrotate.conf > /etc/logrotate.tmp && mv -n /etc/logrotate.conf /etc/logrotate.conf.bak && mv -f /etc/logrotate.tmp /etc/logrotate.conf”; done