if [ $# != 2 ];
then
echo usage:sh regular_clean.sh file_path file_days
exit
fi
path=$1
day=$2
if [ ! -d $path ];then
echo "the file is not exist"
exit
fi
if [ -s $path ];then
echo "stop within 30 seconds if the file is wrong"
sleep 30
fi
echo "server will begin after 5 seconds if arrives current time"
while true
do
sleep 5
hour=`date +%H`
minute=`date +%M`
if [ $hour -eq 12 ] && [ $minute -lt 10 ];
then
find $path -mtime +$2 -type f|xargs rm -rf
echo "the work is done"
fi
done