Tags
webcam vindaloo vim version vegan unix unicef trojan todo tmux thinkpad textmate testing tagging syntax svn sugar subversion stubbing sphinx spam spaces solaris sitemap site sinatra shoulda sheet set security search schema_info SchemaInfo ruby rinari restaurant relationships refresh rdiff-backup ramaze railsconf08 railsconf07 rails protools production power placeboeffect pink floyd PIC perl overheat outbreak osx os x NYHS NYC nginx netbeans nested nanophotonics mysql music MPEG-4 mongrel model migration microvolunteer macbook mac logrotate logic log linux less leopard keynote JAX javascript java jacksonville iterm2 iterm imunizator highlighting hanna Handbrake haml hacks google geocoding genghistron gem gaming gabrielle's funny functional fun friends food fixesThe Decider said over 4 years ago permalink Comment? (0)
Tagged: admin logrotate
Rotating Rails Logs via logrotate
No need to repeat the excellent article NullisLove
If you are doing this on a ubuntu or debian based system make sure that logrotate is actually installed. It’s easy to be fooled since apache and mysql install rotate scripts in /etc/logrotate.d
To install:
sudo apt-get install logrotateAdd your new config file to: /etc/logrotate.d
/home/my_server/www/shared/log/*.log { daily missingok rotate 7 compress delaycompress notifempty copytruncate }Test:
sudo logrotate -d /etc/logrotate.c/my_servers_rotate_scriptForce a rotate:
sudo logrotate -f /etc/logrotate.c/my_servers_rotate_scriptSometimes the easy things can just be-fuddle you!