From d4fcb369a26507a1fbaa38789cdfd06c559b8c39 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sat, 15 Mar 2025 23:08:02 +0200 Subject: nicer log archiving --- lib/_ak_log | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/_ak_log') diff --git a/lib/_ak_log b/lib/_ak_log index de7c2ae..5ab6392 100755 --- a/lib/_ak_log +++ b/lib/_ak_log @@ -65,15 +65,16 @@ function _ak_log_grep(){ } function _ak_log_rotate(){ + cd $AK_WORKDIR if [ -f $AK_LOGSFILE ] then - tar cvfz $AK_ARCHIVESDIR/logs_$(_ak_datetime_unix).tar.gz $AK_WORKDIR/logs + tar cvfz $AK_ARCHIVESDIR/logs_$(_ak_datetime_unix).tar.gz logs cat /dev/null > $AK_WORKDIR/logs fi if [ -f $AK_WORKDIR/akd.log ] then - tar cvfz $AK_ARCHIVESDIR/akd-logs_$(_ak_datetime_unix).tar.gz $AK_WORKDIR/akd.log - cat /dev/null > $AK_WORKDIR/akd.log + tar cvfz $AK_ARCHIVESDIR/akd-logs_$(_ak_datetime_unix).tar.gz akd.log + cat /dev/null > akd.log fi } -- cgit v1.2.3