I've got a set of tools which periodically (about once a day) generate a complete set of static HTML pages for a site with associated folder structure etc.
I then need to put those file onto the production server, my problem is that the server runs IIS(6 I think) and I only have regular FTP access.
I need a way to automate the process of publishing the new site and it needs to a total replacement of the files each time its published, eg delete the whole folder & contents then put the new ones up.
My source server is a ubuntu machine and I've got total control at that end, I have tried using CurlFTpFS but it seems to be too slow for what I'm trying to do and locks up.
-
I would checkout FUSE with ftpfs, this way you could simply mount the external Server via ftpfs and work with it like a regular Filesystem, so just write a script to update the whole page. I'm using FUSE with ftpfs on my Mac and it performs quite well there, so I guess Linux shouldn't be much of a difference.
Warner : This seems like it would be more fallible that most solutions.Sam Machin : I;ve tried ftpfs but its far too slow and seems to timeout. Think I may need an FTP script of some sort was hoping someone might have one.djangofan : as a sidenote, from a windows7 perspective this is how i would do it, by mapping a drive with FTP protocol...From SideShowCoder -
Write a script. You might find Expect suitable, which has less of a learning curve for some people. I typically do something like this to redirect input in bash:
ftp HOST<<_EOF USER PASSWORD ls _EOF
Sam Machin : That was the sort of thing I was thinking, I just can't figure out how to remove all the old files first.Warner : `delete` and `mdelete`. Read the manpage for the ftp client.From Warner -
Use rsync if you can. Rsync allows you to generate diff files that show what has changed, what exists on the target but not in the source, etc. It will make this kind of task much easier.
There are several repackagings of rsync for Windows.
From Charles Stewart -
cwrsync is a port of rsync for Windows - Easy to install if you have admin access (it sounds like you may not). Alternatively have your host set up rsync on the server to PULL from your Ubuntu box if possible. If neither is possible perhaps look for a more flexible host to meet your needs.
The fuse based ftp, and/or scripts, are going to be MUCH harder unless you have a very small set of files - You're likely to time out, have partial uploads, etc. rsync is VERY simple and really designed to manage this type of challenge.
-
Yuu could use the Kermit FTP client, which has its own scripting language/syntax for automating FTP uploads. Seems finicky, but looks like it should be able to do the trick
http://www.columbia.edu/kermit/ftpclient.html
From Seanchán Torpéist -
Try lftp ; it's scriptable and etc, and supports commands like 'mrm' (multi-remove) and 'mput' (multi-put) that should be helpful. And it's packaged etc for ubuntu, so
aptitude install lftp
will let you try it out easily.
From pjz
0 comments:
Post a Comment