All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbndpoms_duplicate_file_remover.sh
Go to the documentation of this file.
1 #! /bin/bash
2 # Script to find, delete and retire duplicate files
3 
4 #$1 The common part of the definition name up to the stage
5 
6 defbasename=$1 # TODO: Check this is passed and is a valid dataset
7 #stages=( gen g4 detsim reco1 reco2 caf ) # TODO: make this a parameter to be passed, with these as the defaults
8 stages=( gen_g4_detsim_reco1 reco2_caf ) # TODO: make this a parameter to be passed, with these as the defaults
9 
10 for stage in ${stages[@]}
11 do
12  defname="${defbasename}_${stage}_sbnd"
13  echo "On stage: $stage with defname: $defname"
14 
15  # Check the dataset exists
16  if [ ! $(samweb -e sbnd list-definitions | grep "$defname") ]
17  then
18  echo "Definition not found by SAM"
19  exit 1
20  else
21  samweb -e sbnd list-definition-files --summary $defname
22  fi
23 
24  fifeutils_run_duplicate_finder_descendants.sh $defname | tee "${defname}_dupes.txt"
25 
26  echo "Found $(grep $stage ${defname}_dupes.txt | wc -l) $stage duplicate files with $(wc -l ${defname}_dupes.txt) files including ancestors"
27 
28  convert_filename_to_ifdh_path.sh "${defname}_dupes.txt" | tee "${defname}_ifdh.txt"
29 
30  echo
31 
32  # TODO: get y/n confirmation to delete the files
33  # This will ensure that we do not delete the whole dataset by accident
34 
35  # ifdh_delete_files.sh "${defname}_ifdh.txt"
36  # sam_retire_files.sh "${defname}_dupes.txt"
37 done
#define the
process_name gaushit a
process_name opflash particleana ie ie y
return match has_match and(match.match_pdg==11 or match.match_pdg==-11)
then shift fi
if &&[-z"$BASH_VERSION"] then echo Attempting to switch to bash bash shellSwitch exit fi &&["$1"= 'shellSwitch'] shift declare a IncludeDirectives for Dir in
do i e
stream1 can override from command line with o or output services user sbnd
list
Definition: file_to_url.sh:28