rm diff file

#!/bin/bash
#date:20120227
#author:zhangluya
#script about rm diff file

#---------------------------------------------------------------------------------------------
#create dir
Dir="/home/zhangly/log"

if [ ! -d ${Dir} ]
   then
     /bin/mkdir -p ${Dir}
      chmod 777 ${Dir}
fi
#-----------------------------------------------------------------------------------------------
#define var
Static="/www/xywy/static/"
Static_tmp="/www/xywy/static_tmp/"

#define file number
Static_num=`ls -l /www/xywy/static|awk '{print $9}'|grep -v ^"[a-z]"`
loop=1
for File in ${Static_num}
   do
   cd ${Static}${File}
   ls -l|awk '{print $9}'|grep ^"[0-9]" > /home/zhangly/log/${File}.txt
   echo "-----${File}--------------"

for Html in `cat "${Dir}/${File}.txt"`
  do
  ls -l ${Static_tmp}${File} |awk '{print $9}'|grep "${Html}" >/home/zhangly/log/${File}-grep.txt
  #loop=`expr $loop + 1`
  if [ $? == 0 ]
   then
 #echo "${Html} is here..."
  echo ""
   else
 /bin/mv /www/xywy/static/${File}/${Html} /home/zhangly/log
 echo "${File}/${Html}|"
  fi
done
 done

分割线
感谢打赏
江西数库信息技术有限公司
YWSOS.COM 平台代运维解决方案
 评论
 发表评论
姓   名:

Powered by AKCMS