Removing old scripts, renaming and cleaning up
This commit is contained in:
5
Okiru
5
Okiru
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user