backup_dir="/usr/local/projects/mtkjbpq/api/rollback/log-rollback"
log_file="/usr/local/projects/mtkjbpq/api/consoleMsg.log"
backup_file="$backup_dir/$(date +'%Y-%m-%d_%H-%M-%S')_consoleMsg.log"

# 备份日志文件
cp $log_file $backup_file

# 删除 30 天前的备份文件
find $backup_dir -type f -name "*.log" -mtime +30 -delete
# 添加定时任务
crontab -e
# 追加
0 0 */10 * * /usr/local/projects/mtkjbpq/api/logR.sh