Backing up photos from your Mac to Synology using rsync.

February 27, 2014  •  4 Comments

If you're reading this it's likely that you're a photographer (be it amateur or pro) and whether or not you're currently doing anything about it, you know in the back of your mind that it is vitally important to have a rock solid backup strategy in place for your photos. You've come to the right place. In the coming paragraphs I'm going to outline the challenges you might face and what to do about them in the paragraphs to come.  

It is true of most photographers today that our assets come in two forms — gear and digital media. You've got your gear insured and you feel good about that. Great! But what about your digital assets? All of your photos are wrapped up on an external drive or two. Is that good enough? The answer is NO WAY. Hard drives all eventually die and so it is highly recommended that you have two or even three copies of your photos, and in data redundant environments, if possible.  

Enter the Synology DiskStation. There are a number of reasons why I chose (and recommend) Synology but I'll spare a lot of the mundane technicalities and just say this — simply put, Synology offers a wide array of products which ensures they have something to meet every backup need, and they by far most robust software suite of any off-the-shelf solution on the market.

Wondering what the heck rsync is?  Wikipedia says "rsync is a utility software and network protocol for Unix-like systems that synchronizes files and directories from one location to another while minimizing data transfer by using delta encoding when appropriate."  The shorter, easier to understand answer is that rsync is a means to backup files from one place to another over your network.

Before we dive into the rSync configuration, I want to answer one question I get often about backing up photos.  Why not just use Time Machine? There are a number of reasons:

  1. Besides the fact that I find the way Time Machine handles external drives a little clunky, it also works continuously in the background.  This means you need to have your drives connected all the time in order for it to be backing up.  This isn't realistic for most photographers.  
  2. I very much prefer to do my backups completely and on a routine schedule rather than in the background as the system sees fit.  I makes much more comfortable having confirmation that my backup job succeeded. 
  3. Have you ever inspected the contents of a Time Machine backup? Nope.  Because you can't.  Apple handles this all for you which is great if you need to revert to a previous system state based on a given date and time, but it isn't so great if you just want your files backed up in a safe location that you can browse to later.  

Okay, of the preamble. Let's get down to business shall we?

Getting Everything to Play Nice Together

1. Configure your Synology DiskStation to allow network backup

The first thing you'll need to do is make sure your NAS is configured correctly. Start by logging in to your DiskStation through the web interface. 

Then click the application launcher in the top left corner of the web interface and select Control Panel.

From the Control Panel select Network Backup.

Make sure that the Enable network backup service box is checked. Then click Apply.


2. Setup a new shared folder for your backups

This is where you will tell rsync to send your backups. Once again navigate to the control panel. This time open Shared Folder.

Click the Create button to create a new network shared folder.

Give your new share a name and description. IMPORTANT: The name should not contain spaces. Then press OK.

You will be prompted to set permissions for the new share. Give Read/Write access to any user accounts you will use to create backups from. Then press OK.  

You should now be able to access your new share from you computer.  Let's give it a try!


3. Verify your new share is accessible from your computer

Open a new finder window, navigate to your DiskStation and verify that you see your new share.  If you don't know how to connect to your DiskStation as a server, instructions can be found on the Synology website.  


How To Use Rsync

1. Launch Terminal

Either by navigating to Applications / Utilities / Terminal or by hitting ⌘+Space and typing Terminal.

2. Launch rsync via command line interface

In the Terminal window, type the following BUT DO NOT PRESS ENTER: "rsync -av " 
You don't want the quotes, but you do want the space behind -av.  

3. Tell rsync where to find your file source (photos, etc to be backed up)

The entire syntax for the rsync command is "rsync (arguments) (source) (destination)" 
In this case our arguments (-av) tell the program to maintain time & date permissions (a) and copy in verbose mode (v) so you can see what's going on.  

To tell rsync where to find your file source we're going to use the drag-and-drop interface built into Mac OS.  

Open finder and locate your source. In my case it's my external drive. Single click and hold on the folder / drive to backup, drag it into the terminal window and release. This will populate the next part of the rsync syntax with the path of your files.

4. Tell rsync where you want to back your files up to (destination)

For this I recommend putting a dated subfolder inside your recently created backup share. The process is the same as above; just drag-and-drop.   










That's it!  Once the syntax is complete, simply press return (enter) and watch in amazement as your files are transported across the network to your DiskStation.

A few more things to consider:

  1. Depending on the number of files/folders you have to backup this could take quite a while. 
  2. Your computer needs to remain on and with the drive connected until your backup completes.
  3. Make sure your computer is plugged in and won't go to sleep on its own.  
  4. I usually set mine up to backup over night and it's always done when I wake up the next day.
  5. Your backups will work fine over WiFi as long as you have a good solid router though they will be even faster if you use a hard-wired connection. I use an Airport Extreme router and usually just let them go over wireless.  
  6. You may occasionally get a few copy errors.  This is usually due to rsync not being able to copy certain locked system files.  Don't panic!  This is fairly normal.  Just make sure it didn't error out on any of the files you actually want backed up.  

I hope you find this information helpful. Now go!  Backup your files!

-- Andrew Birklid


Jolly Roger(non-registered)
Late to the party, but you're actually just doing a file-system level rsync over AFP mounts, so you don't even need to enable the rsync service on the NAS because you're not using it. If you were using the rsync protocol, your command line would be something like rsync -rtvu /macpath user@nas::ModuleName/subpath
When using a NAS drive, rSync has the benefit that the files on the external drive are directly accessible from the file system.

Time machine does this for local drives (you can open the time machine back-up in the finder and get the file you want) but for network drives it breaks them into small chunks so you have to use the Time Machine control panel to retrieve your files. Time Machine does that to minimise the cost of incremental changes to a file, but rSync does this anyway.
A bit late, but I'm curious in this scenario why you chose rsync? If you're always copying the files to a new folder on the DiskStation, wouldn't a straight copy be simpler? It'll also be quicker as it's much less CPU intensive (performance will vary based on DiskStation).

For example I'm currently in the process of backing up one DiskStation to another using rsync over a gigabit network and only achieving 18MB/s with the CPU on the destination DiskStation (DS216se - the most basic available) running at 100%. The DS216se is rated to about 60MB/s when using a straight copy.

For me the only advantage I see with rsync is that if you modify a file on your source drive and copy to the same destination folder, it'll only copy the changed files. With how you described it it'll always be copying the files to a new folder so will always copy everything.

Happy to hear if I've mis-interpreted what you're doing.

Rsync rox! and I LURVE my DS-412+.

You might want to include the -c option too. Checksumming your files is wise because no amount of any kind of RAID setup will detect a corruption at the file or block level. A little bitrot will not screw you up until you really need the file, and then it will be too late.

You should also routinely checksum your primary storage too so you can catch corruption before it gets backed up.

Maybe someday the Synology will support ZFS. That's be cool but its owned by Oracle from their Sun acquisition so not likely.

Yeah, it's a very rare thing, but we're talking pix here, with a significant number of them being valuable for years if not generations to come. So just like film folks store their negatives in cold, dry places, you can do the digital equivalent by routing checksumming.
No comments posted.

January February (1) March (1) April May June July August September October November December
January February March April May June July August September October November December
January February March April May June July August September October November December
January February March April May June July August September October November December