diff --git a/Phys/B2KShh/job/list_of_deletable_files.py b/Phys/B2KShh/job/list_of_deletable_files.py new file mode 100644 index 0000000..ee3a3d2 --- /dev/null +++ b/Phys/B2KShh/job/list_of_deletable_files.py @@ -0,0 +1,29 @@ +diracfiles = [] +with open('lhcb-user-e-egraveri.lfns', 'rb') as infile: + for line in infile: + diracfiles.append(str(line).strip()) + +savefrom_1 = 124829 -1 +saveuntil_1 = 124837 +savefrom_2 = 124958 +saveuntil_2 = 124966 + +#myrange = range(savefrom_1, saveuntil_1+1) + range(savefrom_2, saveuntil_2) +myrange = range(savefrom_2, saveuntil_2) + +for i in myrange: + print i + +with open('files-to-delete.lfns', 'wb') as ofile: + for df in diracfiles: + delete = True + #if '2016' in df: + # delete = False + for i in myrange: + if ('2016_01/%s/' % i in df): + delete = False + if 'LDSB.' in df: + delete = True + if delete: + print "EXTERMINATE: %s" % df + ofile.write('%s\n' % df)