Log rotate files from servers to avoid running out of disk space - proudcloud/awesome GitHub Wiki

Check files larger than 10M within /data directory

$ find /data -size +10M -ls

Check storage usage

$ df -h

Open /etc/logrotate.conf

$ sudo nano /etc/logrotate.conf

Add this at end of file

/data/app_name/shared/log/*.log {
  daily
  missingok
  rotate 7
  compress
  delaycompress
  notifempty
  copytruncate
}