Closed jbwhit closed 10 years ago
$ cat relink.bash
#!/bin/bash
newdir="/nfs/cluster/qso/mmurphy/data1/uves_qso_archive/185.A-0745/raw"
for brokenfile in $(find . -type l ! -exec test -e {} \; -print);
do
rootname=$(ls -l $brokenfile | awk '{print $NF}' | awk 'BEGIN{FS="/"}{print $NF}')
\rm $brokenfile
ln -s $newdir/$rootname $brokenfile
done
And run:
cd /lustre/projects/p028_swin/jwhitmore/data/UVES/185.A-0745/qso
find . -type d -exec sh -c '(cd {} && bash /lustre/projects/p028_swin/jwhitmore/data/UVES/185.A-0745/qso/relink.bash)' ';'
All symbolic links broken after raw data moved.