分类: LINUX
2009-08-26 14:11:15
1,
#!/bin/sh
F="xxxx.ftp"
echo "open 192.168.7.51 21" > $F
echo "user username passwd" >> $F
echo "bin" >> $F
echo "cd /home/xxx/" >> $F
echo "mput $1" >> $F
echo "bye" >> $F
ftp -i -in < $F
rm -rf $F
2,
#!/bin/sh
FILE=$1
ftp -i -in <open 192.168.7.9 21
user username password
cd /
mput $FILE
bye
!
1.编辑.netrc,增加如下一行: machine 服务器地址 login 用户名 password 密码 2.编辑一个文件.ftp_cmd,存储ftp命令用: 代码:
10 4 * * 0 ftp -i < .ftp_cmd |