#!/bin/bash
for entry in /var/lib/mysql/mysql-bin*.*
do
dtFile=$(date -r $entry +'%Y%m%d%H%M%S')
dtBefore=$(date -d "-1 hours" +'%Y%m%d%H%M%S')
#echo "$dtFile"
#echo "$dtBefore"
if [ "$dtBefore" -gt "$dtFile" ] && [ "$entry" != "mysql-bin.index" ];
then
#echo "$entry"
rm -f $entry
fi
done
歡迎光臨 ADJ網路實驗室 (http://dz.adj.idv.tw/) | Powered by Discuz! 6.0.0 |