Here's how to setup rsync to backup certain directories on Mac OS X, or even the entire system, to BIPmedia backup servers. If you need any help, send us an email or give us a call. Info is on the Contact Page.
Remember Your Username: In the instructions below, you should replace any instance of username with the login name that you were given when you signed up for your account.
Note on Other Servers: Several people have asked us if it is possible to use these instructions to setup rsync to servers other than BIPmedia. While we certainly encourage the use of our backup plans, the answer is yes; you are welcome use these instructions to backup to any server. All you need to do is make sure you have rsync running on the remote server, replace username.BIPmedia.com below with use your own server's name, and manually add your SSH key to your authorized_keys file in the 'Activate Your Key' step, below.
Step I. Setup a Security (SSH) Key & Copy It To BIPmedia
rsync, the software will be using to backup your data to the BIPmedia backup servers, comes free with Mac OS X. In order to make a secure connection to the BIPmedia backup servers, you need to create an SSH key.
You'll want to run all of the commands here as the Mac OS X 'super-user' (root), so that you have full access to all the files on your machine. To do this, we preface each command with 'sudo', as shown below.
I.a. Enable Administrator Access. Go to Control Panel -> Accounts and make sure the 'Allow user to administer this computer' box is checked for your user account. You may need to click on the 'Lock' icon and enter your password before you can make changes.
I.b. Bring up a Terminal Window by going to Macintosh HD -> Applications -> Utilities -> Terminal.
I.c. Create the backup directory. All of your backup configuration files need to be stored somewhere. We recommend /backup. Issue the command to create the directory:
sudo mkdir /backup
You will need to enter your OS X login password here, to authenticate yourself.
I.d. Create the Key. Issue the command:
ssh-keygen
Hit enter for all default prompts. Note: by leaving the password blank you will be able to connect to the server even if you internet connection goes down. iSync will auto resetart when your connection cones back up.
I.e. Upload the Key to BIPmedia. Issue the command (all on one line):
scp ~/.ssh/id_rsa.pub username@snoopy.bipmedia.com:
This will ask you if you want to connect to username@snoopy.BIPmedia.com, since the host can't be verified. Type 'yes'. Then it will ask you for your account password, which you should enter. If it doesn't say anything after that, the upload was a success. If it didn't work, check your username and password, and make sure you replaced the word 'username' above with your actual username.
Note: if you are planning to use this account for multiple servers, you should rename id_rsa1.pub to id_rsa2.pub for the second server, id_rsa3.pub for the third, and so on.
Step II. Test the Backup
Now you've got the authentication all setup. All that is left is to start the backup. We strongly recommend you do a small test backup first, to make sure everything is working.
II.a. Run a test backup. The command below will backup all the files on your Desktop to the 'backup-test' directory on the backup server. Type this all on one line.
sudo rsync -avz -e "ssh -i /backup/ssh_key" "Desktop" username@username.BIPmedia.com:backup-test
You should see all the files on your desktop being transferred to the backup server. If you don't, triple-check all your settings, and if you still don't, contact us for help.
II.b. Verify the test backup. Using an SFTP program, login
to your account via SFTP and navigate into the 'backup-test' directory. You should see the files from your desktop in that directory! Assuming that everything looks good, you may want to delete those files so they don't use part of your quota.
Step III. Setup & Automate the Backup
The final step is to setup and automate the backup. You'll use a small script to do this, and we've created a sample for you to help you get started.
III.a. Decide what to backup. You'll first need to decide which files and directories you want to backup. You are welcome to backup whatever data you like; however we recommend focusing on critical customer data first and
foremost.
III.b. Setup a backup script. You'll setup all the rsync commands to run via a script, which can be run via 'cron' on Mac OS X each night. We've provided a sample for you to get started; after you download it, read through the comments in the file for more instructions. You should store the files in the backup folder that you created earlier (e.g. /backup). Download Now »
III.c. Run your first FULL backup manually. (Optional) We recommend you run your first full backup from the command line, so that you can monitor it in case anything goes wrong. To do this, just run the backup script after you've got it setup:
sudo /backup/data-backup.sh
If it doesn't work, make sure that you've double checked all your settings in the script. Also make sure the script is executable by the root user (generally, typing 'chmod 755 /backup/data-backup.sh' will fix any permission issues). If something is still wrong, contact us.
You're Done!
You're now done! Your computer will backup the data you specified whenever you've asked it to, using the efficient rsync protocol. If you ever want to check the backup, simply use SFTP to go into the backup server.