j0h

Log_life

j0h
Mar 23rd, 2026
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. Storage lifespan with 20 GB (20,480 MB)
  2. 1 unit
  3. 20,480 ÷ 1.5 ≈ 13,653 days ≈ 37.4 years
  4. 10 units
  5. 15 MB/day → 20,480 ÷ 15 ≈ 1,365 days ≈ 3.7 years
  6. 25 units
  7. 37.5 MB/day → 20,480 ÷ 37.5 ≈ 546 days ≈ 1.5 years
  8. 50 units (worst case)
  9. 75 MB/day → 20,480 ÷ 75 ≈ 273 days ≈ 0.75 years
  10.  
  11. journalctl --vacuum-size=500M
  12. journalctl --vacuum-time=30d
  13. journalctl --vacuum-files=10
  14. ## Journal Vacuum
  15. /etc/systemd/journald.conf
  16. SystemMaxUse=500M # total disk usage cap
  17. SystemKeepFree=100M # leave this much free space
  18. SystemMaxFileSize=50M # max size per journal file
  19. MaxRetentionSec=30day # max age
  20.  
  21. #logrotate:
  22. /etc/logrotate.conf
  23. $ cat /etc/logrotate.conf
  24. # see "man logrotate" for details
  25. # global options do not affect preceding include directives
  26. # rotate log files weekly
  27. weekly
  28. # use the adm group by default, since this is the owning group
  29. # of /var/log/syslog.
  30. su root adm
  31. # keep 4 weeks worth of backlogs ##
  32. rotate 4
  33. # create new (empty) log files after rotating old ones
  34. create
  35. # use date as a suffix of the rotated file
  36. #dateext
  37. # uncomment this if you want your log files compressed
  38. #compress
  39. # packages drop log rotation information into this directory
  40. include /etc/logrotate.d
  41.  
  42. ## actual log config:
  43. $ cat /etc/logrotate.d/rsyslog
  44. /var/log/syslog
  45. /var/log/mail.info
  46. /var/log/mail.warn
  47. /var/log/mail.err
  48. /var/log/mail.log
  49. /var/log/daemon.log
  50. /var/log/kern.log
  51. /var/log/auth.log
  52. /var/log/user.log
  53. /var/log/lpr.log
  54. /var/log/cron.log
  55. /var/log/debug
  56. /var/log/messages
  57. {
  58. rotate 4
  59. weekly
  60. missingok
  61. notifempty
  62. compress
  63. delaycompress
  64. sharedscripts
  65. postrotate
  66. /usr/lib/rsyslog/rsyslog-rotate
  67. endscript
  68. }
  69.  
  70.  
Advertisement
Add Comment
Please, Sign In to add comment