#!/bin/bash

mount /memstick

# Make directories on the stick.
find -name "*" -type d | grep -v CVS | sed -e 's/\./\/memstick/' | xargs mkdir

# Copy files to the appropriate place
find -name "*" -type f -printf "%p /memstick/%h\n" | grep -v CVS | grep -v "make_stick" | sed -e 's/\.\///g' | xargs -n2 cp

umount /memstick