A nice way to automate website updates

I used to update my website manually by SCPing any new file to the remote server.

Now I use rsync, which only sends the diff of files that have actually changed. Awesomely enough, it uses the same syntax as scp. Add --delete to delete extraneous files on the remote server.

To automate this process, I’ve created a Makefile in the folder for my personal website, on my own machine. I just type make after making any changes, and my website is updated efficiently.

As a side effect, you can see my makefile at my website: http://cs.unc.edu/~mollison/Makefile. Of course, I can make that not be there by adding something to the command so that it will ignore the Makefile, but it doesn’t do any harm.

Update: I may also start storing my website in git, and then just telling rsync to ignore hidden directories like the .git directory. It’s a neat idea, but I haven’t really needed any of git’s features when working on my website, yet. I can think of why I might want to. It would be nice to do a branch and use that at certain times, e.g. if I want to put up a custom page on holidays.

One Comment

  1. the main health and beauty secrets…

    the main health and beauty secrets…