Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. **** create file: sudo vi /etc/logrotate.d/descriptive_name_here
  2. **** code example, e.g., this one is symfony:
  3.  
  4. /var/www/current/var/logs/prod.log {
  5. su ubuntu www-data
  6. daily
  7. missingok
  8. rotate 14
  9. compress
  10. }
  11.  
  12. **** IMPORTANT: first line is path to application's log, so change to match
  13. **** change "su ubuntu www-data" to user/group application runs under, i.e., www-data www-data for nginx
  14. **** test config with sudo logrotate --d /etc/logrotate.d/file_name_from_above
  15. **** option force rotation: sudo logrotate --force /etc/logrotate.d/file_name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement