Deploy website with rsync
Recipe for copying my Acrylamid-generated static html website to my webhost (nearlyfreespeech.net).
In a nutshell, I use QtdSync to generate the basic rsync update script, and then add rsync advanced options as make sense to me. From QtdSync's progress screen the rsync command line can be copied and pasted to create a batch file (strip the
-e ... sshpass... line for interactive password prompting).
QtdSync is a bit twitchy around the "backup/don't backup into subfolder" options. Sometimes they appear to have the opposite effect of what they say. I still found it much easier than trying to construct the appropriate rsync script from scratch myself, just test on a small data set until the settings are ironed out. The backup set
.qtd files are straightforward XML so it's pretty easy to check the results of your settings.
QtdSync hard coded rsync options
These are always used.
-rltv which means:
--links - copy symlinks as symlinks
--times - preserve modification times
--progress - show progress
QtdSync editable advanced rsync options
--delete - delete extraneous files from destination dirs
--force - force deletion of directories even if not empty
--ignore-errors - delete even if there are I/O errors
--hard-links - preserve hard links
Extended rsync options
Add these in the Rsync Expert Settings pane. When added as Task they override the global settings.
--compress - compress file data during the transfer, saves bandwidth, speeds up transfers, 'nuff said
--skip-compress=%_ignore_ext% - skip compressing files with a suffix in LIST, not yet using, but seems like a good idea
--checksum - skip based on checksum, not mod-time & size, because preserving timestamps between Windows and 'nix doesn't always work. I suspect it's faster to use
--modify-window=NUM with a window like 2secs (that's what
xxcopy /ff uses) but I'm not that concerned with performance and checksum should be more reliable.
For these next two, if something goes wrong the website will stay in previous state. Not quite the same as atomic updates in a db but close enough for me.
--delay-updates - put all updated files into place at transfer's end
--delete-delay - find deletions during, delete after
--human-readable - output numbers in a human-readable format