- 论坛徽章:
- 0
|
本帖最后由 itl68_0007 于 2014-02-17 16:13 编辑
新手一枚,想从别的服务器上下载文件到指定目录,直接输入命令可以实现
后来因为要批量处理,想写个脚本实现仿照了别人写过的脚本学无止境 16:12:24
lftp -c "set ftp:list-options -a;
open ftp://$USERPASS@$HOST;
mkdir -p $RCD"
it=1
while ((it<=7))
do
sleep 300
mkdir -p /public/pub/ZJWARRS/LOG/ZJWARRS/${STARTDATE}
mkdir -p /public/pub/ZJWARRS/RESULT/${STARTDATE}
rsync -av --delete ${ZJWARRS_LOGDIR}/ /public/pub/ZJWARRS/LOG/ZJWARRS/${STARTDATE}
rsync -av --delete ${WRFPOST_PICDIR}/ /public/pub/ZJWARRS/RESULT/${STARTDATE}
lftp -c "set ftp:list-options -a;
open ftp://$USERPASS@$HOST;
lcd $LCD;
cd $RCD;
mirror --reverse --verbose --only-newer"
let ++it
done
然后 这个是自己写的
#!/bin/sh
lftp ftp://kys:kys123@10.135.30.154;
echo hello world!;
mirror /GFS05/gfs.2013120112 /public/home/wrf/METDATA_DOWNLOAD;
# --exclude-glob a-dir-to-exclude/ \
# --exclude-glob a-file-to-exclude \
# --exclude-glob a-file-group-to-exclude* \
# --exclude-glob other-files-to-esclude"
~
提示 mirror command cannt found ?这么是什么问题啊, |
|