2013/12/22

FTP synchronization. How to update your sites via FTP?

Upload your site via FTP. This is usual offer bundled with web hosting solutions. Nowadays it is mostly SFTP, for secure communication.

There are various sophisticated FTP synchronization solutions. But you can also use simple LFTP script to achieve the same. The lftp command is available in most of the Linux distributions.

Here is example script I put in some of the projects which are deployed as pure static HTML/CSS:

lftp -u username -e "set ssl:verify-certificate no; mirror --reverse --delete --only-newer -v site_source_dir /; exit" ftp.somewebhosting.org

It works like a charm thanks to this reverse mirror approach.

But there are better ways of pushing changes to your static sites. If your are interested, watch out the next post which should appear soon.