From 4701665aa82de2e9f96a8f983ce6b90bdf668da1 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Fri, 7 Jun 2024 03:00:11 +0300 Subject: Refactoring --- bin/ak-log-rotate | 7 ++----- bin/ak-startup | 2 +- lib/_ak_log | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/bin/ak-log-rotate b/bin/ak-log-rotate index ddf8f84..bac076c 100755 --- a/bin/ak-log-rotate +++ b/bin/ak-log-rotate @@ -1,7 +1,4 @@ #!/bin/bash +source $AK_LIBDIR/_ak_log -tar cvfz $AK_ARCHIVESDIR/logs_$(date -u +%s).tar.gz $AK_WORKDIR/logs - -cat /dev/null > $AK_WORKDIR/akd.log -cat /dev/null > $AK_WORKDIR/akd.err -cat /dev/null > $AK_WORKDIR/logs +_ak_log_rotate diff --git a/bin/ak-startup b/bin/ak-startup index 66a100d..bd1d582 100755 --- a/bin/ak-startup +++ b/bin/ak-startup @@ -5,5 +5,5 @@ source $HOME/.arching-kaos/rc ak-ipfs-starter ak-log-rotate # screen -dmS akdaemon -ak-daemon > $AK_WORKDIR/akd.log 2> $AK_WORKDIR/akd.err & printf '%s' "$!" > $AK_WORKDIR/akd.pid +ak-daemon > $AK_WORKDIR/akd.log 2>&1 & printf '%s' "$!" > $AK_WORKDIR/akd.pid # ak-logfollow diff --git a/lib/_ak_log b/lib/_ak_log index d2760e6..09eb1dc 100755 --- a/lib/_ak_log +++ b/lib/_ak_log @@ -36,10 +36,10 @@ _ak_log_grep(){ } _ak_log_rotate(){ - tar cvfz $AK_ARCHIVESDIR/logs_$(date -u +%s).tar.gz $AK_WORKDIR/akd.log $AK_WORKDIR/akd.err $AK_WORKDIR/logs + tar cvfz $AK_ARCHIVESDIR/logs_$(date -u +%s).tar.gz $AK_WORKDIR/logs + tar cvfz $AK_ARCHIVESDIR/akd-logs_$(date -u +%s).tar.gz $AK_WORKDIR/akd.log cat /dev/null > $AK_WORKDIR/akd.log - cat /dev/null > $AK_WORKDIR/akd.err cat /dev/null > $AK_WORKDIR/logs } -- cgit v1.2.3