WinSCP for FlatPress Backup

The benefit of FlatPress is that it doesn’t use a database… this approach pivots to the axiom of “keep it simple” which should make the rendered site fast, secure, and portable (for example, when I ported from Blosxom to FlatPress). One area where this is particularly evident is backup as all you have to do is copy the content files off the server. You can run this either sever side (putting the files somewhere) or client side (pulling them to a local machine). I’ve opted for the latter approach and my tool of choice is WinSCP (and the portable version), an open source FTP client that includes a n extensive number of reliable and extensible tools. I’ve found WinSCP better than FileZilla, not least because it has reliably handled large file transfers and maintains the create dates of any files you transfer.

Of particular importance for automating FlatPress backup are directory synchronisation and scripting. In fact, the WinSCP GUI can generate the script for you based upon existing profile settings. For completeness this is the very simple script that runs:

open ftp://<username>:<password>@ftp.yourserver.com
lcd c:`\mywebsitebackup
cd /mywebste.com/htdocs
synchronize local -mirror
close
exit

This opens a connection to the server, changes the local and remote directories before mirroring from the remote to the local. On Windows I can then schedule this to run as a daily task.

A good tool for the arsenal!

Add comment

Fill out the form below to add your own comments