Keep your Masternode logs cleaned up, don't let it eat up all the space on your VPS!

in masternode •  7 years ago 

This is going to be a quick one. It follows along with the rest of my docs regarding setting up a masternode, monitoring, and now the fun subject of log rotation!

Once your masternode is running, you'll notice your debug.log is filling up. It will continue filling up, until one of two (or sometimes both things) will happen:

  1. Your VPS will run out of space. This will cause your masternode to die, possibly corrupting the end of the blockchain in the process.
  2. If you have tons of space on your VPS, the debug.log may reach a size where the masternode daemon simply is unable to add data to it. If your masternode is 32bit, this will come rather quickly, and weird things will happen. For 64bit this is less likely, but expect weirdness when hitting the hundreds of gigabytes zone.

So how to avoid this? Very easily, using a tool you already have installed called 'logrotate'.

Simply create a file called 'coins.conf' in /etc/logrotate.d:

/home/coins/.bitcloud/debug.log {
        copytruncate
        rotate 4
        dateext
        minsize 10M
        notifempty
        compress
        delaycompress
        missingok
}

Replace .bitcloud with whatever coin you use. .zcoin for Zcoin, .8bit for 8Bit coin, etc.

This will keep your masternode healthy for a long time!

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Congratulations @koguma! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!