cd `dirname $0`
cd ../dstore

#start importing at this file
FIRSTFILE=$1

for XMLFILE in cache/*.xml
do

#only start after we find the first file

  if [ "cache/$FIRSTFILE.xml" = "$XMLFILE" ] ; then

    FIRSTFILE=""

  fi

  if [ -z "$FIRSTFILE" ] ; then

    echo $XMLFILE
    ./dstore import "$XMLFILE" || exit 1

  else

    echo SKIP $XMLFILE

  fi
done
