Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to synchronise FTP directory from command line?

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 there was be a command line utility or plugin to Eclipse PDT to do this.

like image 299
Tom Smykowski Avatar asked Mar 28 '09 18:03

Tom Smykowski


People also ask

How do I sync a folder to an FTP server?

To synchronize, go to Commands > Synchronize (in the main menu). The Synchronize dialog will appear, where you can select a synchronization mode and configure options. If you are using the Explorer interface you may now select the local directory which you want to synchronize.


2 Answers

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
like image 81
FlemishBeeCycle Avatar answered Oct 13 '22 01:10

FlemishBeeCycle


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)

like image 31
Tom Smykowski Avatar answered Oct 12 '22 23:10

Tom Smykowski