#!/bin/ksh
REMOTE_HOST="192.168.1.100"
FTP_USER="root"
FTP_PWD="123456"
cd /usr/myscripts/ftpmvtmp
while read LINE1
do
date=`echo $LINE1|awk -F'_' '{print $1}'`
date1=`echo $LINE1|awk -F'_' '{print $2}'`
date2=`echo $LINE1|awk -F'_' '{print $3}'`
filedate1="20"+$date1
filedate2="20"+$date2
while read LINE2
do
setdir=`echo $LINE2|awk -F'_' '{print $1}'`
optdir=`echo $LINE2|awk -F'_' '{print $2}'`
cd /BKFILE/$date/$setdir
ftp -n <open $REMOTE_HOST
user $FTP_USER $FTP_PWD
mkdir $optdir
cd /$optdir
mkdir $filedate1
mkdir $filedate2
cd $filedate1
bin
prompt
mput *_$optdir_$filedate1*
cd ..
cd $filedate2
mput *_$optdir_$filedate2*
bye
!
done < /usr/myscripts/ftpmvtmp/workfile2.txt
done < /usr/myscripts/ftpmvtmp/workfile1.txt
exit 0
workfile1.txt
20080501_080423_080424
20080502_080424_080425
20080503_080425_080426
20080504_080426_080427
workfile2.txt
1CV/JPG/IMAGE_1890
3CV/JPG/IMAGE_3890
FCV/JPG/IMAGE_7809
1IL/JPG/IMAGE_1480
2IL/JPG/IMAGE_2480
注意这个地方
ftp -n <...
! //前面因为少下面一个"!"号, 结果脚本就一直报错
因为
while read LINE
do
done < $file
怀疑可能是因为这个引起的,因为我在其他脚本里面没有下面一个"!"号,脚本运行没有错误
还不知道在AIX ksh下面ftp命令是怎么使用的,下次补上
阅读(2347) | 评论(0) | 转发(0) |