#!/bin/bash
#删除指定目录下超过指定时间的文件
filepath1="/apps/temp_ma/SDO/"
filepath2="/apps/temp_ma/KFC/"
filepath3="/apps/sals/logs/"
declare filepath="$filepath1 $filepath2 $filepath3"
days=7
#删除过期的文件
function foreacedel2(){
echo "argument is:"$1;
find $1 -type f -mtime +$days|xargs rm -f;
}
function foreach(){
echo $filepath
for x in $filepath
do
foreacedel2 $x;
done
}
foreach;
#删除指定目录下超过指定时间的文件
filepath1="/apps/temp_ma/SDO/"
filepath2="/apps/temp_ma/KFC/"
filepath3="/apps/sals/logs/"
declare filepath="$filepath1 $filepath2 $filepath3"
days=7
#删除过期的文件
function foreacedel2(){
echo "argument is:"$1;
find $1 -type f -mtime +$days|xargs rm -f;
}
function foreach(){
echo $filepath
for x in $filepath
do
foreacedel2 $x;
done
}
foreach;