Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On my local PC server. I have some HTML files which update every few minutes.

I need to update/upload those files on a dir on my website every 5 minutes.

Currently I'm using a batch script and ftp.exe to upload files to my site, but this is not stable solution because ftp.exe process gets stuck in process and it won't upload files again via ftp unless I kill the process.

Can someone give me better solution.

I am using Windows server.

share|improve this question
up vote 1 down vote accepted

First let me say this seems like a bad design. Seems like it would be better to have the website read from a database or some type of data store and dynamically generate the HTML rather than copying from one machine to another. But that's just my opinion.

As you've noted FTP can be brittle. Maybe a better approach would be to have Windows task scheduler launch a PowerShell script to FTP the files. The Powershell script could have exception handling and exit after the files are copied or if there are errors.

share|improve this answer
can I use SSH?. – Mowgli Apr 9 '13 at 15:12
Yes you can use SFTP. I think the important thing is to have each process the scheduler kicks off either be able to complete or handle any exceptions in a reasonable time before the next process kicks off. – Brad Patton Apr 9 '13 at 15:20
Thanks you answered my question, I have 2 ftp processes, and it gets hung now and then, and I am not using SFTP, can you tell me what are my options fro SFTP since windows doesn't have SFTP. – Mowgli Apr 9 '13 at 15:22
I would start with Cygwin or PUTTY. – Brad Patton Apr 9 '13 at 15:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .