From 3e68548d7f18363712cf4d45dbf9a1a3cfad3ac3 Mon Sep 17 00:00:00 2001 From: Tuan Pham Anh Date: Sat, 14 Oct 2023 11:42:26 +0700 Subject: [PATCH] proxy: enable logrotate for public proxy --- proxy/public/run.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/proxy/public/run.sh b/proxy/public/run.sh index 04ec47bc..82518fe2 100644 --- a/proxy/public/run.sh +++ b/proxy/public/run.sh @@ -1,5 +1,5 @@ pacman -Syu --noconfirm -pacman -S --noconfirm base-devel wget dnsutils nginx cronie screen +pacman -S --noconfirm base-devel wget dnsutils nginx cronie screen logrotate # write env vars to bash file, so that cronjobs or other scripts could know cat <> $HOME/env.sh @@ -84,14 +84,16 @@ EOT sleep 1 echo "*/5 * * * * root /bin/bash $HOME/cron_update_upstream.sh" > /etc/cron.d/cron_update_upstream sleep 1 -crond ######################################################################################################################## ## logrotate -#sed -i -e "s/{.*/{\n\tdaily\n\trotate 2/" /etc/logrotate.d/nginx -#sed -i -e "s/create.*/create 0644 root root/" /etc/logrotate.d/nginx - +sed -i -e "s/{.*/{\n\tdaily\n\trotate 2/" /etc/logrotate.d/nginx +sed -i -e "s/create.*/create 0644 root root/" /etc/logrotate.d/nginx +echo "0 0 * * * root logrotate /etc/logrotate.d/nginx" > /etc/cron.d/cron_logrotate ######################################################################################################################## + +crond + echo "Done!" # loop forever for debugging only while true; do sleep 5; done