Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

change eos cp and eos mkdir as per eosteam #605

Merged
merged 1 commit into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions cWrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cd $BASE_DIR

modulename=`echo $1 | sed 's/\.py//' | sed 's/Unified\///'`
mkdir -p $HTML_DIR/logs/$modulename/
eos mkdir -p $FINAL_HTML_DIR/logs/$modulename/
env EOS_MGM_URL=root://eoscms.cern.ch eos mkdir -p $FINAL_HTML_DIR/logs/$modulename/

last_log=$HTML_DIR/logs/$modulename/last.log
s_dated_log=$modulename/`date +%F_%T`.log
Expand All @@ -24,15 +24,15 @@ echo $$ >> $log
if [ -r unified_drain ] ; then
echo "System is locally draining" >> $log
cp $log $last_log
eos cp $log $FINAL_HTML_DIR/logs/$modulename/.
eos cp $log $FINAL_HTML_DIR/logs/$modulename/last.log
env EOS_MGM_URL=root://eoscms.cern.ch eos cp $log $FINAL_HTML_DIR/logs/$modulename/.
env EOS_MGM_URL=root://eoscms.cern.ch eos cp $log $FINAL_HTML_DIR/logs/$modulename/last.log
exit
fi
if [ -r /eos/cms/store/unified/unified_drain ] ; then
echo "System is globally draining" >> $log
cp $log $last_log
eos cp $log $FINAL_HTML_DIR/logs/$modulename/.
eos cp $log $FINAL_HTML_DIR/logs/$modulename/last.log
env EOS_MGM_URL=root://eoscms.cern.ch eos cp $log $FINAL_HTML_DIR/logs/$modulename/.
env EOS_MGM_URL=root://eoscms.cern.ch eos cp $log $FINAL_HTML_DIR/logs/$modulename/last.log
exit
fi

Expand Down Expand Up @@ -74,7 +74,7 @@ echo `date` >> $log

#cp $log $dated_log
cp $log $last_log
eos cp $log $FINAL_HTML_DIR/logs/$modulename/.
eos cp $log $FINAL_HTML_DIR/logs/$modulename/last.log
env EOS_MGM_URL=root://eoscms.cern.ch eos cp $log $FINAL_HTML_DIR/logs/$modulename/.
env EOS_MGM_URL=root://eoscms.cern.ch eos cp $log $FINAL_HTML_DIR/logs/$modulename/last.log

#rm $log
4 changes: 2 additions & 2 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ def close(self):
try:
print "moving",self.cache_filename,"to",self.eos_filename
print("Attempt {}".format(T))
r = os.system("eoscp %s %s"%( self.cache_filename, self.eos_filename))
r = os.system("env EOS_MGM_URL=root://eoscms.cern.ch eos cp %s %s"%( self.cache_filename, self.eos_filename))
if r==0 and os.path.getsize(self.eos_filename) > 0: return True
print "not able to copy to eos",self.eos_filename,"with code",r
time.sleep(30)
Expand Down Expand Up @@ -3028,7 +3028,7 @@ def save(self):

## write the information out to disk
new_base_eos_dir = 'root://eoscms.cern.ch/'+base_eos_dir
os.system('eoscp %s/closedout.json %s/closedout.json.last'%(new_base_eos_dir, new_base_eos_dir))
os.system('env EOS_MGM_URL=root://eoscms.cern.ch eos cp %s/closedout.json %s/closedout.json.last'%(new_base_eos_dir, new_base_eos_dir))

## merge the content
try:
Expand Down