Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Scenario:

  1. Record content using camera to CF card.
  2. Copy contents of CF card to local HD in named folder (e.g. 20120311-D01). I don't mind changing script to update the name I want to use, doesn't have to be auto-named folder.
  3. Copy contents of local HD folder to USB HD (second copy).
  4. Purge CF card.

I have updated my travel kit to be MacBook Air rather than Windows system I used previously. In the previous setup, I used robocopy scripts for steps 2 & 3. The added benefit was that the step three was setup to be a mirror operation (sync/update) so if I had time to do photo or video post processing I could rerun and it would only sync the changed files.

I'm new to OSX and my poor research skills turned up using possibly "ditto" or "rsync" and was told to look into "carbon copy cloner" and "superduper."

In short, I'd like a simple method to copy the contents of my CF card to my Macbook Air, then a second copy to a external USB drive for security.

share|improve this question
    
It looks like rsync should have the features I'm looking for. –  Walinmichi Apr 11 '12 at 21:30
add comment

2 Answers 2

up vote 0 down vote accepted

I normally do rsync -av /home/source/folder/here /Volumes/Disk1/destination/folder/here on my scripts with rsync, and for scheduling I use Lingon. Crontab really wasn't working for me, but Lingon works all the time. I found a free GPL download of 2.2 and it works perfectly fine for me, but you can even buy version 3 directly from the Mac App Store for $3. Remember all Network Drives, Connected USB/Firewire drives are in the /Volumes directory as their own folder. Hope this Helps!

share|improve this answer
    
The rsync is the simple solution that is closest to robocopy on Windows. Thanks! –  Walinmichi Apr 12 '12 at 17:24
add comment

The first thing you should probably try would be Hazel. You could also try modifying a shell script like this.

#!/bin/bash

dir1=/Volumes/CF/Photos
[[ ! -e "$dir1" ]] && exit

dir2=~/"Pictures/Photos"
mkdir -p "$dir2"

i=1
date="$(date +%Y%m%d)"
target="$dir2/$date-D$(printf %02d $i)"
while [[ -e "$target" ]]; do
    ((++i))
    target="$dir2/$date-D$(printf %02d $i)"
done

mkdir "$target"
mv "$dir1" "$target"
echo "Moved $dir1/ to $target/"

dir3="/Volumes/Backup/Photos"
[[ ! -e "$dir3" ]] && exit
rsync -a "$dir2" "$dir3"
echo "Copied $dir2/ to $dir3/"

To run it whenever the CF volume is mounted (or some files on it are modified), you could save a property list like this as for example ~/Library/LaunchAgents/com.superuser.411351.plist and load it with launchctl load ~/Library/LaunchAgents/com.superuser.411351.plist.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN
http://www.apple.com/DTDs/PropertyList-1.0.dtd>
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.superuser.411351</string>
    <key>Program</key>
    <string>/usr/bin/copyphotos</string>
    <key>WatchPaths</key>
    <array>
        <string>/Volumes/CF/</string>
    </array>
</dict>
</plist>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.