rails log rotation
2009 November 12
No need to restart by following this post:
http://www.hostingrails.com/401/What-is-the-best-practice-for-rails-log-rotation-How-to-use-logrotate
#!/bin/sh
mkdir /mnt/app/releases/mysite.com/log/archive -p
tar czf "/mnt/app/releases/mysite.com/log/archive/`date +%Y%m%d`_production.tar.gz" -C / mnt/app/releases/mysite.com/log/production.log
cat /dev/null > /mnt/app/releases/mysite.com/log/production.log
find /mnt/app/releases/mysite.com/log/archive/* -mtime +180 -exec rm {} \;