首页 > 代码库 > 常用shell

常用shell

curtime=$(date +%Y%m%d%H%M)

for i in $@
do
find ${bkwikiLocation} -mtime +21 -name "${i}_*" -type d -exec rm -rf {} \;
if [ -d ${wikiLocation}${i} ]; then
mkdir ${bkwikiLocation}${i}_$curtime
cp -rf ${wikiLocation}${i}\/* ${bkwikiLocation}${i}_${curtime}
else
echo "请检查输入的模块是否正确."
fi
done

常用shell