views:

64

answers:

4

I have edited about 100 html files locally, and now I want to push them to my live server, which I can only access via ftp.

The HTML files are in many different directories, but hte directory structure on the remote machine is the same as on the local machine.

How can I recursively descend from my top-level directory ftp-ing all of the .html files to the corresponding directory/filename on the remote machine?

Thanks!

A: 

umm, maybe by pressing F5 in mc for linux or total commander for windows?

Qwerty
+1  A: 

If you want to do it in Python (rather than using other pre-packaged existing tools), you can use os.walk to read everything in the local subtree, and ftplib to perform all the FTP operations. In particular, storbinary is the method you'll usually use to transfer entire files without line-end conversions (storlines if you do want line-end conversions, for files that are text, not binary, and that you know need such treatment).

Alex Martelli
A: 

After searching PyPI, I found ftptool (http://pypi.python.org/pypi/ftptool/0.4.2). Its mirror_to_remote method could be what you need. I don't have an FTP server handy, though, so I couldn't test it.

LeafStorm
A: 

if you have a mac, you can try cyberduck. It's good for syncing remote directory structures via ftp.

jdizzle