开发通常在本机上,测试通过后再上传。如果频繁、小步更新的话,可以用下面的脚本来执行。比如,修改了一个 文件 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 < user username "$Password" #Change to your username
binary
cd pass/to/starting/directory #Change it
bye
End-Of-Session
exit 0
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did8390