Chinaunix首页 | 论坛 | 博客
  • 博客访问: 280931
  • 博文数量: 109
  • 博客积分: 5814
  • 博客等级: 大校
  • 技术积分: 1440
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-26 10:17
文章分类

全部博文(109)

文章存档

2010年(9)

2009年(36)

2008年(64)

我的朋友

分类: LINUX

2010-03-08 09:19:01

#write by crastyl
#20100203
#contact crastyl@163.com
#!/bin/sh
desdir="/back"
if [ ! -d "$desdir" ];then
     mkdir $desdir
fi
sourdir="/root"
result=$(find "$sourdir"|wc -l)
if [ $result -gt 0 ]
then
   cp -Rr $sourdir $desdir
else
   echo "quit"
fi

阅读(865) | 评论(1) | 转发(0) |
0

上一篇:crontab 精确到秒

下一篇:apache 压缩和expire

给主人留下些什么吧!~~

chinaunix网友2010-03-10 13:07:31

这个是一个判断是否某个文件夹存在的shell吧?