How to synchronise FTP directory from command line?

前端 未结 7 1394
盖世英雄少女心
盖世英雄少女心 2020-12-24 04:04

I have a website with PHP files and other. I would like to do one-click synchronisation between my local copy of a website and my website on the server. It would be nice if

相关标签:
7条回答
  • 2020-12-24 04:30

    I've been using scriptFTP on my dedicated windows servers for well over a year to synchronise my database backup directories with my local servers. It's an excellent product that allows you to script (to a pretty sophisticated level) and schedule virtually any FTP task.

    I have no connection with the product - just an extremely impressed user. The product solves precisely the problem it's is designed to solve and has proven totally solid for me. It's commercial - USD$35 - but one of the best $35 I ever spent on software.

    0 讨论(0)
  • 2020-12-24 04:32

    There is a tool called FTP Synchronizer (for Windows) which can be ran from a command line. You can't synchronize files by FTP without using any FTP library. The more mature is this library has the faster it will synchronize files (for example it can cache already synched file info in it's internal database).

    Don't like FTP Synchronizer? Google for alternative.

    • FTP Synchronizer - Windows
    • BatchSync FTP - Windows
    • Synchronize It - Windows
    • ScriptFTP - Windows
    • Weex - Free, Open Source, Unix
    • ftpsync2d at code.google.com - Free, Open Source, Python
    0 讨论(0)
  • 2020-12-24 04:34

    I've found WinSCP. It's FTP, free and Open Source: http://winscp.net/eng/docs/start

    And it works from command line with comparision of files (to synchronise it)

    0 讨论(0)
  • 2020-12-24 04:39

    I would recommend lftp. It's a sophisticated, scriptable command-line FTP client.

     lftp has builtin mirror which can download or update a whole
     directory tree. There is also  reverse  mirror  (mirror  -R)
     which  uploads or updates a directory tree on server. Mirror
     can also synchronize directories between two remote servers,
     using FXP if available.
    

    lftp -f mirror.sh

    mirror.sh

    open sftp://<username>:<password>@<ip address>
    mirror -c /<source> /<destination>
    exit
    
    0 讨论(0)
  • 2020-12-24 04:43

    Sounds to me like a perfect application for version control software. Pick mercurial or git and use it for both version control and synchronization within the directories on the two machines. Mercurial is more user friendly overall and has a smoother install and presence on windows, though setting up git on windows is no longer too much of a hassle either.

    0 讨论(0)
  • 2020-12-24 04:52

    PhpStorm just added two-way sync (over FTP and others) into their most excellent PHP IDE. This feature is in the current 3.0 EAP (beta), not in the 2.1 version.

    0 讨论(0)
提交回复
热议问题