Add logrotate configuration

This commit is contained in:
Levent Duivel 2025-02-02 23:22:59 +05:00
parent 381c5c1442
commit a5c8961d78
3 changed files with 19 additions and 0 deletions

View File

@ -12,3 +12,12 @@ Install
4. Enable the `xray` service in LuCI (System -> Startup, it should be at the end of the list) and reboot your router.
(In case it fails to work, you may disable the service and reboot the router again to revert the effects)
crontab
-------
I've added these in my crontab for more stable work of router:
```
0 20 * * 0 /sbin/reboot # Reboots device at 1:00 AM UTC+5 every week
59 19 * * * /bin/bash /root/restart_xray.sh # Restarts Xray at 0:59 AM UTC+5 every day
0 * * * * /usr/sbin/logrotate -s /usr/share/logrotate/status /etc/logrotate.conf # Run logrotate every hour
```

10
etc/logrotate.d/xray Normal file
View File

@ -0,0 +1,10 @@
/etc/xray/log/*.log {
hourly
rotate 24
missingok
notifempty
compress
delaycompress
copytruncate
dateext
}

View File