Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. ## Free System Space from Massive Logs
  2.  
  3. 1. Remove compressed log files from /var/log
  4. ```bash
  5. $ sudo find /var/log -type f -name "*.gz" -delete
  6. ```
  7. 2. Truncate Log files
  8. ```bash
  9. $ cd /var/log
  10.  
  11. $ sudo truncate -s 0 mail.log
  12. $ sudo truncate -s 0 mail.log.1
  13.  
  14. $ sudo truncate -s 0 syslog
  15. $ sudo truncate -s 0 syslog.1
  16. ```
  17. 3. Truncate Nginx error/access logs
  18. ```bash
  19. $ cd to_nginx_log_dir
  20. $ sudo truncate -s 0 error.log access.log
  21. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement