Guest User

Untitled

a guest
Jul 20th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. /path/to/your/logfile/*.log {
  2. compress
  3. copytruncate
  4. delaycompress
  5. minsize 1G
  6. missingok
  7. nomail
  8. notifempty
  9. rotate 30
  10. }
  11.  
  12. [Unit]
  13. Description=Rotate My Log
  14.  
  15. [Service]
  16. Type=oneshot
  17. ExecStart=/usr/sbin/logrotate /etc/systemd/system/mylogrotate.config --state /etc/systemd/system/mylogrotate.state --verbose
  18.  
  19. [Unit]
  20. Description=Rotate My Log Timer
  21.  
  22. [Timer]
  23. OnCalendar=*:00:00
  24. Persistent=true
  25.  
  26. [Install]
  27. WantedBy=timers.target
  28.  
  29. systemctl enable mylogrotate.timer
  30. systemctl start mylogrotate.timer
Add Comment
Please, Sign In to add comment