How to rsync from Siteground to backup your website using OSX.

This is quite technical, but I’m putting it here so I don’t forget, and for anyone else who may be helped!

Rsync is a file copying protocol that allows you to copy an entire directory. It’s like an automated version of ftp, but it uses the SSH protocol not ftp. Here’s how to make a backup from SiteGround to your Macintosh Computer using rsync.

  1. Login to SiteGround and use the SSH Keys Manager to create an SSH key. You can use any ‘name’ for it, but keep a note of the password that you use.
  2. Under ‘Manage SSH keys’ go to ‘SSH Credentials’ and take note of the following:
    Hostname: 
    Username: 
    Password: 
    Port: 
  3. Open a Terminal in OS X
  4. Type the following (you can edit it in a text editor then paste it in):
rsync --recursive --verbose --archive -e 'ssh -p 18765 ' --progress --delete --stats USERNAME@HOSTNAME:path/public_html /Users/wayne/Sites/foldername/

Notes:

  • site ground use a non-standard ssh port of 18765 for rsync, that’s why you need the ‘ssh -p 18765’
  • Make sure that around the ‘ssh -p 18765’ it uses those straight up and down quotes, not curly ones. To get then you use control-shift-‘ instead fo just shift-‘
  • USERNAME is the username from siteground
  • PASSWORD is the password from siteground
  • path/public_html is the path to the directory you want to backup
  • /Users/wayne/Sites/foldername is the path on your OSX that you want to make the backup to.
  • You can add –dry-run to the above command to to a practice run. (e.g. off it after –verbose or –archive as another argument.) This is always a good idea. Then remove –dry-run for the real backup.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Exit mobile version