Skip to content
Snippets Groups Projects

Fix immediate failure on copy_cvmfs failure (BMK-15)

Merged Andrea Valassi requested to merge valassi/hep-workloads:BMK-15 into qa
1 file
+ 7
2
Compare changes
  • Side-by-side
  • Inline
+ 7
2
@@ -209,11 +209,16 @@ function copy_cvmfs(){
###rm -rf ${MAIN_CVMFSEXPORTDIR}/cvmfs/.data # this is slow, rsync is faster (https://unix.stackexchange.com/a/79656)
cd ${MAIN_CVMFSEXPORTDIR}/cvmfs; mkdir EMPTYDIR; rsync -a --delete EMPTYDIR/ .data || fail "[copy_cvmfs] rsync"; cd - # NB for rsync, add a trailing "/" to the source and none to the target
date
[[ -e $MAIN_HEPWLBUILDDIR/cvmfs ]] && echo "[copy_cvmfs] removing cvmfs dir in $MAIN_HEPWLBUILDDIR/" && rm -rf $MAIN_HEPWLBUILDDIR/cvmfs
if [ -e $MAIN_HEPWLBUILDDIR/cvmfs ]; then
echo "[copy_cvmfs] removing cvmfs dir in $MAIN_HEPWLBUILDDIR/"
rm -rf $MAIN_HEPWLBUILDDIR/cvmfs
fi
echo "[copy_cvmfs] mv ${MAIN_CVMFSEXPORTDIR}/cvmfs $MAIN_HEPWLBUILDDIR "
mv ${MAIN_CVMFSEXPORTDIR}/cvmfs $MAIN_HEPWLBUILDDIR || fail "[copy_cvmfs] cannot mv ${MAIN_CVMFSEXPORTDIR}/cvmfs $MAIN_HEPWLBUILDDIR"
# FIXME: if cms repo, need to copy by hand the SITECONF/local, because it's a sym link
[[ -e /cvmfs/cms.cern.ch/SITECONF/local ]] && ( cp -r -H /cvmfs/cms.cern.ch/SITECONF/local $MAIN_HEPWLBUILDDIR/cvmfs/cms.cern.ch/SITECONF/ || fail "[copy_cvmfs] cannot cp /cvmfs/cms.cern.ch/SITECONF/local" )
if [ -e /cvmfs/cms.cern.ch/SITECONF/local ]; then
cp -r -H /cvmfs/cms.cern.ch/SITECONF/local $MAIN_HEPWLBUILDDIR/cvmfs/cms.cern.ch/SITECONF/ || fail "[copy_cvmfs] cannot cp /cvmfs/cms.cern.ch/SITECONF/local" # BMK-15: do NOT use '.. && ( .. || fail )'
fi
ls $MAIN_HEPWLBUILDDIR/cvmfs
echo "[copy_cvmfs] finished at $(date)"
return 0
Loading