Articles tagged 'rsync'
rsync Jan 14 2008
Switched to using rsync to deploy this blog now. Since I re-wrote the blogging software to generate a simple static html site, I needed an easy way to deploy. I was using a Capistrano-esque method of deploying the entire site to dated directories (‘200801142252’, for example), and then I was simply symlinking the public web directory to the most recent release. This has the benefit of being able to quickly roll-back to previous releases (handy when doing major template changes etc), but having to re-deploy the entire site every time I wrote a post wasn’t really very efficient. So I’ve changed it to use the rather brilliant rsync to maintain the site on the webserver now. From my ruby code, I just shell out to rsync as follows:
`rsync -avzr -e ssh #{LOCAL_PATH}/* #{REMOTE_USER}@#{REMOTE_HOST}:#{REMOTE_PATH}`
This runs rsync in verbose, archive mode, using compression, and runs recursively. It specifies the local path, and the remote path for use over ssh (I was using scp over ssh before anyway). It’ll prompt for the password on the command line (although you could setup and specify a key to use with the ssh connection to avoid that). This solution will then keep the local and remote paths in sync, and will mean I can update the blog much more easily and quickly. Hopefully that’ll mean a few more regular posts coming soon… :-)
Page 1 of 1 |