User Tools

Site Tools

Create a Time Capsule for OS X's Time Machine

Assumes that a Samba share has been created and mounted on the Desktop:

Commands are execute in Terminal window on OS X.

1. Get the computer's name and save it in a variable:

  $ HN=`hostname | cut -f1 -d.`
  $ echo $HN

2. Get the network adapter's address:

  $ MA=`ifconfig en0 | egrep ether | sed "s|:||g" | cut -f2 -d' '`
  $ echo $MA

3. Create a variable for the time capsule's name:

  $ TC="TimeCapsule_$HN"
  $ echo $TC

4. Change to desktop folder:

  $ cd ~/Desktop

5. Create 500GB sparse bundle (change size if desired)

  $ hdiutil create -size 500g -type SPARSEBUNDLE -encryption AES-128 -nospotlight -fs "Journaled HFS+" -volname "$TC" $HN\_$MA.sparsebundle

6. Change the file's permissions to make is 'world read/write'

  $ chmod -R 777 $HN\_$MA.sparsebundle/

7. Copy the sparse bundle to network share

  $ rsync -avE $HN\_$MA.sparsebundle/ /Volumes/raid/Time\ Capsules/$HN\_$MA.sparsebundle/

8. Enable time machine's support of remote volumes

  $ defaults write TMShowUnsupportedNetworkVolumes 1

9. Mount the sparse bundle by double-clicking it:

10. Set time machine's destination to the time capsule

  $ sudo tmutil setdestination "/Volumes/$TC"

11. Start Time Machine's backup