Setup LogRotate
3 min
LogRotate
LogRotate will break your log into a new file daily and keep 7 days of logs and discard old logs.
Important: Make sure your validator start script starts with exec or your validator will go offline for a time each time the logs rotate.
Run as root user, use sudo -i
Copy code block and paste into terminal.
cat > logrotate.xand <<EOF
/home/xand/xand-validator.log {
rotate 7
daily
missingok
postrotate
systemctl kill -s USR1 xand.service
endscript
}
EOF
sudo cp logrotate.xand /etc/logrotate.d/xand
Restart logrotate service
sudo systemctl restart logrotate.service
Continue on to Starting your validator