views:

102

answers:

3

I need to set up some sort of infrastructure to automatically FTP some files from one remote server to another. The FTP transaction will occur on a scheduled basis. Both these server are windows boxes and the location of the files that need to be FTP'ed will depend on the current date (the folder they sit in will be named the current day's date).

Would really hate to have to write something like that from scratch so I was wondering if there are tools/utilities/the likes out there.

A: 

You would think that this would be an easy task. It ain't.

The best tool I've found is SyncBack and I think there is a free/lite version available.

Ray
+2  A: 

Windows Command Line ftp will read input from a text file. For example:

ftp -ni < ftpscript.txt

Where these options are used:

  • -n - Suppresses auto-login upon initial connection.
  • -i - Turns off interactive prompting during multiple file transfers.

The ftpscript.txt would look something like this:

open ftp.mycompany.com
user someuser password
binary
get /somedir/myfile.dat

It should be reasonably straightforward to write a script that outputs an ftp script containing the correct file name.

Dave Webb
A: 

If your in a Windows environment consider using PowerShell and the System.Net.WebClient .net Framework class like this post. This is a download example but the WebClient object also provides an UploadFile method.

Bas Bossink