[Nottingham] Batch ftp?

Matt Bunter matt.bunter at wanadoo.fr
Thu Nov 25 22:16:42 GMT 2004


On Thu, 25 Nov 2004 21:01:45 +0000
David Aldred <david at familyaldred.org.uk> wrote:

> 
> Anyone know an easy way of doing this?
> 
> I have a web project which, for reasons which will be cured soon, is copied 
> across a whole series of directories (so that on the webserver there are 
> copies of for example index.php in nine directories).
> 
> Is there an easy way of uploading a file to a series of directories when I've 
> edited it?
> 
> I'm thinking of something like a command-line tool which could upload the file 
> to a target directory (then I could create a script to run the command nine 
> times to different directories, with a parameter for the file to be 
> uploaded).
> 
> I sppose the other option's an upload script on the server which uploads the 
> file and multiply saves it, but that's potentially open to abuse.....
> 
Create a cron job. Have the job run the ftp commands that you would like performed. 

I have an ftp batch job on a windows machine that calls an ftp.cmd file with something like the following in it.

ftp sysw 
myusername
mypassword
get filename1
put filename2 newfilename1
cd etc. etc.

I'm not an expert in the ftp commands but I'm sure that you can get the files into 9 different directories easily.

rgs,

Matt




More information about the Nottingham mailing list