我開始寫一個(複雜的)FTP分發腳本,但我想:這不可能!我正在重塑車輪!從中央位置在受控條件下可靠地向遠程服務器分發文件與計算機一樣是一項陳舊的任務,該死!FTP分發腳本
請有人證明我是對的。
關於這個問題的谷歌搜索是由Linux世界過度使用「發行」一詞打破。
另外,我知道一切有關rsync和rdist。在這裏,我受限於FTP,所以請不要提出這些建議。
只是爲了展示一下我說的,這是我的(空)腳本頭:
# Example usage: FTPdist.ksh --simulate -l /tmp/Script.sh -r $BIBSH_DIR -d dune,camel -p dgft4sG55 -e expNoob -o itg:itg -c 555
#
# usage: FTPdist.ksh <-l local_file1[,lf2,..]> <-r remote_path> <-d remote_srv1[,remote_srv2,..]> [-t trace_file]\
# <-p FTP_passwd> [-u FTP_login] [-e ext] [-n] [-o owner[:group]] [-c mode] [-g] [-q] [-v [verbosity_level]]
# or: FTPdist.ksh <-f instructions_file> [-n] [-t trace_file] <-p FTP_passwd> [-u FTP_login] [-e ext]
# [-o owner[:group]] [-c mode] [-g] [-q] [-v [verbosity_level]]
#
# By default, FTP_login is "root".
# -n: do a simulation run to see if any FTP/login/rights problems exist.
#
# Distribute <local_file> to all <remote_srvs> using FTP. Target location on remote servers: <remote_path>.
# If a file already exists on remote server, rename it first with date extension + .[ext].
# By default, ownership is preserved. If -o option is provided, ownership will be given to argument.
# This script is meant to connect as root . If you're not using root FTP login, make sure you have
# enough privileges on remote servers/files (do a simulation first with -n).
# If -c option is used, a chmod is performed on the remote file.
如果你有SSH訪問服務器,我會嘗試使用rsync,這更適合於這項任務。 – OneOfOne 2009-07-29 13:37:43
好的,那麼你的問題又是什麼? – ghostdog74 2009-07-29 14:00:48