Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /path/to/your/logfile/*.log {
- compress
- copytruncate
- delaycompress
- minsize 1G
- missingok
- nomail
- notifempty
- rotate 30
- }
- [Unit]
- Description=Rotate My Log
- [Service]
- Type=oneshot
- ExecStart=/usr/sbin/logrotate /etc/systemd/system/mylogrotate.config --state /etc/systemd/system/mylogrotate.state --verbose
- [Unit]
- Description=Rotate My Log Timer
- [Timer]
- OnCalendar=*:00:00
- Persistent=true
- [Install]
- WantedBy=timers.target
- systemctl enable mylogrotate.timer
- systemctl start mylogrotate.timer
Add Comment
Please, Sign In to add comment