UPWORK/ODESK guru: Tips and Tricks for clients

skype: upwork.link , email: info@upwork.link

Using file of system logrotate for compression mongodb log files

without comments

Just insert next code to the /etc/logrotate.d/mongodb:

   /var/log/mongodb/mongodb.log {
           size 10M 
           missingok
           rotate 14
           compress
           notifempty
           mail root@localhost
           create 0640 mongodb nogroup
           postrotate
             killall --signal USR1 mongod
             find /var/log/mongodb -type f -regex '.*/mongodb\.log\.[-0-9]+T[-0-9]+$' -exec rm {} \;
           endscript
  }       

Written by spectre

June 25th, 2013 at 11:57 pm

Posted in Tips and Tricks

Leave a Reply

*