batch-fileftpfilezilla

Synchronizing files from FTP server to local folder on Windows without external tools


I have to synchronize a local folder which contains a copy (not necessarily a backup) of the source code folder on the production environment. Since I'm not allowed to install any new software on neither machines (mine and the server) I'm forced to use the already available tools to script a one way sync from the source code folder on the machine to the local folder on my dev-env (and possibly schedule that script but this isn't covered by the question).

The tools I have are filezilla and batch scripts on the dev-env. Asking to some colleagues I was advised to use the ftp batch command, but I'm not entirely sure this may satisfy my needs. Also should I just ignore Filezilla as an option?


Solution

  • FileZilla does not support any kind of automation:
    Schedule automatic daily upload with FileZilla

    Windows command-line ftp does not support synchronization, only simple copy (and non-recursive only).

    With lots of effort, you can implement synchronization using PowerShell and FtpWebRequest. You can start with this code: PowerShell Script to upload an entire folder to FTP.

    Simplest is to use a 3rd party FTP client, which does not need any installation. For example WinSCP FTP client supports synchronization. And all you need to do to use it, is extract a ZIP archive with its binaries. See Schedule file synchronization to FTP server.
    (I'm the author of WinSCP)