Removing old scripts, renaming and cleaning up

This commit is contained in:
2021-12-18 16:15:54 +02:00
parent f07536cc17
commit 13a7e95a52
7 changed files with 12 additions and 88 deletions

5
Okiru
View File

@@ -50,12 +50,11 @@ logging () {
export REPORT="/home/shmick/Scripts/Logs/$1/$1"
export PREFIX=$1
fi
ls $LOG
if [[ -f "$LOG" ]]; then
OLD_LOG_DATE=$(stat $LOG | grep Modify | awk '{print $2}' | sed -e 's/-//g')
OLD_LOG_TIME=$(stat $LOG | grep Modify | awk '{print $3}' | sed -e 's/://g' | awk -F. '{print $1}')
mv "$LOG" "$(dirname $LOG)/$(basename $LOG)_"$OLD_LOG_DATE"_"$OLD_LOG_TIME"" 2> /dev/null
zstd -11 --rm -f "$(dirname $LOG)/$(basename $LOG)_"$OLD_LOG_DATE"_"$OLD_LOG_TIME"" > /dev/null
mv "$LOG" "$(dirname $LOG)/$(basename $LOG)_"$OLD_LOG_DATE"_"$OLD_LOG_TIME"" 2> /dev/null 2>&1
zstd -11 --rm -f "$(dirname $LOG)/$(basename $LOG)_"$OLD_LOG_DATE"_"$OLD_LOG_TIME"" > /dev/null 2>&1
# ^ Append timestamp (YYYYMMDD_HHMMSS - ex 20210301_093543) to log if it exists
fi
touch $LOG