clip = Params() clip.registerSwitch() Script.parseCommandLine() if not clip.logF and not clip.logD: Script.showHelp() dexit(1) from DIRAC import gConfig from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations ops = Operations() storageElementName = ops.getValue('/LogStorage/LogSE', 'LogSE') from DIRAC.DataManagementSystem.Client.ReplicaManager import ReplicaManager rm = ReplicaManager() from DIRAC.Core.Utilities.PromptUser import promptUser if clip.logD: res = promptUser('Are you sure you want to get ALL the files in this directory?') if not res['OK']: dexit() choice = res['Value'] if choice.lower()=='n': dexit(0) res = rm.getStorageDirectory(clip.logD, storageElementName, clip.outputdir, singleDirectory=True) if not res['OK']: gLogger.error(res['Message']) dexit(1) if clip.logF: res = rm.getStorageFile(clip.logF, storageElementName, clip.outputdir, singleFile = True) if not res['OK']: gLogger.error(res['Message']) dexit(1)