定期删除归档文件的脚本

ncrmastby<*apex*/home/oracle>$cat     /data/run/delarc.sh 


#!/bin/bash
DAYS=7
DIR=/data/apex/arch
EXT=".arc"


echo
echo "Start delarc `date`"

cd $DIR
for file in `find . -depth -mindepth 1 -name \*$EXT -mtime +$DAYS`
do
  echo "Deleting $file"
  rm -f $file
done

echo "Complete delarc `date`"

exit 0

 

 

 

 

请使用浏览器的分享功能分享到微信等