views:

142

answers:

3

I'm starting to write an (sophisticated) FTP distribution script, but I thought: this can't be! I'm reinventing the wheel! Reliably distributing files to remote servers under controlled conditions from a central location is as old of a task as computers are, damn it!

Please someone prove me right.

Google search on this subject is so broken by Linux world over-using the word "distribution".

Also, I know everything about rsync and rdist. Here I am constrained to FTP, so please don't suggest those.

Just to show what I'm talking about, here is the header of my (empty) script :

# 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.
+1  A: 

You might find lftp to be helpful. It's installed by default in many distributions and offers pretty sophisticated functionality.

alberge
I would also recommend lftp over ncftp -- both are very nice, but lftp tends to be more widespread on Linux. (e.g. it's in Ubuntu Main rather than Universe.)
alberge
lftp looks delicious indeed, thanks! I only hope it's available on my companies Unix servers.. I'll have to check this Monday.
ExpertNoob1
A: 

NcFTP Client

Dave Jarvis
A: 

If I was given this task I'd use Expect, AFAIK is available on most unixes, preistalled on linux.

Abdul