            else
              #determine latest date of the files in this dir
              DATA_VERSION=$($GSTAT -c '%y' $(ls -t $k/*.mat | head -n1) | awk '{print $1}')
              #build sink dir
              SINK=$DATADIR/$OBSOLETEDIR/$(basename ${k/.metadata})/$DATA_VERSION
            fi
            #make destination
            [ -d $SINK ] || $ECHO mkdir -p $SINK
            if $BACK && [ -z "$(ls $k/*.mat 2> /dev/null)" ]
            then
              #if the directory is empty, then just get rid of it
              echo "Directory $k is empty, removing it..."
              $ECHO rmdir $k || exit $?
            else