how to create sparsebundle image file in Mac OSX

#!/bin/bash

if [ ! -n “$2” ]; then
echo $0: machine_name MACid
exit 1
fi

hdiutil create -size 80G -type SPARSEBUNDLE
-imagekey sparse-band-size=65536
-fs HFS+J
-volname “Backup $1”
~/Documents/”$1_$2″.sparsebundle

Above is to create a sparsebundle file required for Time Machine backup to remote afp