Somewhat recently I reduced the size of the virtual machine in which I host this blog. It is quite short on memory, but for the price I pay, can’t really complain. Just now I was looking on memory usage on the machine, and noticed ps reporting over 100MB being help by npm: andre@webserver ~]$ ps aux --sort -rss USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND ghost 247 0.
Ghost’s out of the box import/export backup mechanism works well, but doesn’t backup images. I wanted a simple command line I could call to backup my blog and move the backup file out of the server’s file system. Also, I didn’t want to stop Ghost’s node process to create the backup. By default, Ghost uses sqlite as a database, which provides an easy way to perform online backups. Below is a Gist of a small Bash script I put together to login to the blog’s server, perform the online backup of the database, gzip that together with the image folder and then copy over to the local machine.
Finally I got the blog setup with an HTTPS endpoint on Azure. I thought I would write up on the points that weren’t that straight forward. Get a free SSL certificate I used Let’s encrypt to generate me a free SSL certificate for the blog. It will provide you with a domain-validated certificate, which only vouches for the domain identity (good enough for a blog, if you ask me). To issue a certificate to a domain, they will challenge you to prove that you control the domain.