复制内容到剪贴板
代码:#timestamp=".timestamp"
tempfile="/tmp/ftpsyncup.$$"
user="username"
server="serverip"
RDB="/TEST/ANIME/"
RD[1]="[Darker than BLACK][黑色契约者]"
RD[2]="POLYPHONICA_神曲奏界"
RD[3]="CLAYMORE_大剑"
LDB="/var/ftp/comic/TV动画/连载中动画/"
LD[1]="[Darker than BLACK][黑色契约者]"
LD[2]="POLYPHONICA_神曲奏界"
LD[3]="Claymore_大剑"
count=0
timeouter=0
trap "/bin/rm -f $tempfile" 0 1 15 # zap tempfile on exit &sigs
cd "$LDB" #change to local home directory
echo "open $server" > $tempfile
echo "user $user password" >> $tempfile
echo "cd $RDB" >> $tempfile
for ((i=1;i<=1;i++));do
lcd ${LD[i]}
"cd ${RD[i]}" >>$tempfile
for filename in *.rmvb
do
if [ -f "$filename" ] ; then
echo "put -c \"$filename\"" >> $tempfile
count=$(( $count + 1 ))
fi
done
done
echo "quit" >> $tempfile
echo "Synchronizing: Found $count files in local folder to upload."
if lftp < $tempfile ; then
echo "Done. All files synchronized up with $server"
fi
exit 0