Logrotate file configuration


This file will on daily level tell linux to cleanup folder where rails stores log files, and will keep last 30 logs and compress all but last two...

Go to:

cd /etc/logrotate.d/

Create file for example:

vim rails_tracklift

Add this lines to that file (~/tracklift/log/*.log is a path to rails project /log folder):

~/tracklift/log/*.log{ daily missingok rotate 30 compress delaycompress 2 notifempty copytruncate }