#!/bin/bash
# HP20140903 updating Xsym dirs for all files

basedir="/data/pictures/iPhone5/"

for g in 1 2 3
do
src="pictures"$g"-symlink"
echo scanning $src
for d in 0 1 2 3 4 5 6 7 8 9
do
dst="ipn-"$g"-"$d"sym"
mkdir -p $basedir/$dst
cd $basedir/$dst
s=../$src
for i in ` ( cd $s && ls *$d???.* *$d???_png.jpg ) `
do
j=${i,,}
if [[ $s/$i -nt $j ]]
then
#echo ln -f -s $s/$i $j
ln -f -s $s/$i $j
touch -h -r $s/$i $j
fi
done
done
done

#--
