June 25, 2019

I am now updating this website with the power of ‘rsync’, which is a Linux command line utility that I use to automatically sync the changes from my local computer (laptop) to the Digital Ocean droplet that hosts this site. I have also set this to be done on a Crontab job, meaning that if I ever feel like updating this website, I can do so at my own pace, and it will be automatically be updated every 5 minutes. This was also made possible with the idea of using a ‘symlink’, which is in the same vein as using a shortcut, but between two file locations in Linux. Here’s one link to learn about ‘rsync’:

Here’s another to learn about ‘symlink’ or the ’ln’ command in case you’re interested:

A special thank you goes out to people from the #linux channel on IRC that helped me through this process since it was a bit difficult to wrap my head around the process of finally using ‘rsync’ after days of getting so many permission errors.

The specific command in case you would like to use it on your site is as follows, NOTE: I have used parentheses where YOU need to enter in values:

rsync -e 'ssh' -avzp (path/to/public_html/on/local/machine/with/ending/slash/)
user@(ip address for remote server):/path/to/directory/on/website/machine/with/slash/at/end/

Here’s an even more specific example with fake ip address values for context:

rsync -e 'ssh' -avzp /home/user/public_html/ user@555.55.555.5:/home/user/public_html/

One more thing to keep in mind is that you will need to create a symlink between the actual directory that’s necessary to host the website on Apache. For me, this was in var/www/musimatic.net/public_html You will need to create symlink with the “ln” command to create a “link” or “shortcut” to the home directory that’s easily accessible to any user who has SSH access to the machine hosting your website. This part of the process is done so that rsync can do its syncing ability without having to worry about needing any root access.