#!/bin/bash

### MARK: Info
# Last modified at : 2024-07-14 12:00 KST(UTC+09:00:00)
# Last modified by : Cellularhacker (https://github.com/Cellularhacker)

T_PATH_1='/var/log/rsync'
T_PATH_2='/var/log/rclone'
T_PATH_3='/var/log/hoshinova'
T_PATH_4='/var/log/ftpsync'

T_PATHS=($T_PATH_1 $T_PATH_2 $T_PATH_3 $T_PATH_4)


for T_PATH in ${T_PATHS[@]}; do
	find "${T_PATH}" -name '*.log' -type f -size 206 -delete &> /dev/null && \
	find "${T_PATH}" -name 'rsync-ftpsync.log.*' -type f -size 189 -delete &> /dev/null && \
	find "${T_PATH}" -name 'rsync-ftpsync.error.*' -type f -size 131 -delete &> /dev/null && \
	find "${T_PATH}" -name 'ftpsync.log.*' -type f -size 1.8K -delete &> /dev/null && \
	find "${T_PATH}" -name '*.log' -type f -mmin +240 -exec xz -11 -T0 2>/dev/null {} +;
done
