每天早上醒来,看见你和阳光都在,这便是我要的未来。
复制文件到nfs目录,测试nfs挂载是否稳定,运行3天
上一篇 /
下一篇 2012-12-27 10:24:37
/ 个人分类:linux
nohup ./cpFiles.sh >>/usr/local/cpFile.log&
touch cpFiles.sh
vi cpFiles.sh
#!/bin/sh
#source file
CPFILE=/usr/local/netdisk_mysql/tomcat-7.0.30/logs/cpFile.sh
while [ $DESTDATE -gt $NOWDATE ]
do
sleep 10s
#nowdate
NOWDATE=`date -d "now" +%s`
#the next 3 days date
DESTDATE=`date -d "3 days" +%s`
echo "nowdate: $NOWDATE"
echo "the next 3 days date: $DESTDATE"
#destination folder
DESTFILE=/U01/disk/$RANDOM.sh
if cp $CPFILE $DESTFILE
then
echo "copy file sucess:$DESTFILE"
echo "nowdate: $NOWDATE"
echo "the next 3 days date: $DESTDATE"
else
echo "error:could not copy the files"
exit 1
fi
done
echo "ending....."
exit 1
收藏
举报
TAG: