Backup tip

An advanced computing tip today on speedlighter…:

Have a Mac or UNIX-like computer? Then you can use a simple little command to synchronise disks. Let me explain.

I have two hard disks next to the Mac. Two 3TB disks (I just upgraded them).  I work on one: all my images and Lightroom files and office admin files live there. Then I have the other.

Whenever I work, as soon as I am done on one and am sure it’s all good, I run the following command on my mac:

I.e. the following is the actual commands; the lines preceded by # are just comments:

rsync -a –verbose –progress –stats –delete /Volumes/MVW-3TB-1/Lightroom/ /Volumes/MVW-3TB-2/Lightroom/

rsync -a –verbose –progress –stats –delete /Volumes/MVW-3TB-1/MVW-Docs/ /Volumes/MVW-3TB-2/MVW-Docs/

rsync -a –verbose –progress –stats –delete /Volumes/MVW-3TB-1/Photos/ /Volumes/MVW-3TB-2/Photos/

The rsync command intelligently compares the two disks and adds anything to disk 2 that was added to, or changed on, disk 1, while deleting anything from disk 2 that was deleted on disk 1. A perfect backup in seconds (the first time can take a day of course, depending on how full your first disk is).

Using the nano text editor, I put these commands in a little text file called “syncdisks”, and I make that file executable using the chmod command (chmod 755 ./syncdisks). I then call that file by typing .syncdisks every time I want to run it.

I could automate further but this is good for me – and it shows the power of the command line, doesn’t it? Of course you would modify this to reflect the names of your disks and your folders to be copied.

(If this was all a bit techie for you, ignore this post and move on to tomorrow!)

 

Bookmark and Share

About Michael Willems

Michael is a professional photographer and photography teacher and private coach. Based in Ontario, he teaches and shoots worldwide. See more at www.michaelwillems.ca and www.speedlighter.ca
This entry was posted in Digital Darkroom. Bookmark the permalink.

4 Responses to Backup tip

  1. richard davies says:

    good tip do you know if this tip can be done on a windows computer?

    • William vaz says:

      For Windows XP and 7, I use a utility which can be downloaded from Microsoft for free called RoboCopy. In a DOS command line enter;

      Robocopy a: b: /mir (a: = source drive, b:=destination drive)

      There are several other functions that can be used in RoboCopy but the above command will make a clone of your source drive.

  2. Dave says:

    Hi Michael,

    In the Mac Disk Utility, you can designate any two drives as a RAID pair. This will automate the process eliminating the need for a script. Its also fun watching the two drive activity LED’s flashing in perfect unison.

    Dave

  3. Tigro says:

    Rsync is a very nice tool (a favourite one, in fact)

    You could also use the -u (or –update) option to save some time
    by skipping newer files on target.

    Dave: Rsync is better than RAID in the way that you have some “delay” in the backup to prevent accidental delete (by human mistake… more often than hardware failure !!!)
    When you Rsync your drives every early morning, if you mess up during the day, you can still restore from the last night’s backup. On RAID, the mistake is carefully replayed both sides, so you loose everything. Time machine would be an option in this case (on Mac)

Leave a Reply

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

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>