好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

ftp 自动更新文件的脚本代码

开发通常在本机上,测试通过后再上传。如果频繁、小步更新的话,可以用下面的脚本来执行。比如,修改了一个 文件 scripts/example.php, 通过下面的命令来执行更新: ./autoftp.sh scripts/example.php 脚本文件autoftp.sh如下,要定制修改的地方都做了注释: #!/bin/bash

# todo: uplaod more than one file.

E_ARGERROR=85

if [ -z "$1" ]

then

echo "Usage: `basename $0` Filename-to-upload"

exit $E_ARGERROR

fi

Server="IP/Domain Name" #Change it

Password="password" #Change it

ftp -n $Server &lt; user username "$Password" #Change to your username

binary

cd pass/to/starting/directory #Change it

bye

End-Of-Session

exit 0

查看更多关于ftp 自动更新文件的脚本代码的详细内容...

  阅读:42次