jbwhit / LargeProgramme

This is a place for the results from the UVES Large Programme 185.A-0745 collaboration.
MIT License
0 stars 0 forks source link

Need to relink after lustre nfs move #24

Closed jbwhit closed 10 years ago

jbwhit commented 10 years ago

All symbolic links broken after raw data moved.

jbwhit commented 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)' ';'