From a5c8961d787a5f2232fc9b766ccaff3c7a99cecb Mon Sep 17 00:00:00 2001 From: Levent Duivel Date: Sun, 2 Feb 2025 23:22:59 +0500 Subject: [PATCH] Add logrotate configuration --- README.md | 9 +++++++++ etc/logrotate.d/xray | 10 ++++++++++ usr/share/logrotate/status | 0 3 files changed, 19 insertions(+) create mode 100644 etc/logrotate.d/xray create mode 100644 usr/share/logrotate/status diff --git a/README.md b/README.md index 893bedc..47e1fa6 100644 --- a/README.md +++ b/README.md @@ -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 +``` \ No newline at end of file diff --git a/etc/logrotate.d/xray b/etc/logrotate.d/xray new file mode 100644 index 0000000..89fbdfd --- /dev/null +++ b/etc/logrotate.d/xray @@ -0,0 +1,10 @@ +/etc/xray/log/*.log { + hourly + rotate 24 + missingok + notifempty + compress + delaycompress + copytruncate + dateext +} \ No newline at end of file diff --git a/usr/share/logrotate/status b/usr/share/logrotate/status new file mode 100644 index 0000000..e69de29