diff --git a/src/DIRAC/WorkloadManagementSystem/Agent/PilotSyncAgent.py b/src/DIRAC/WorkloadManagementSystem/Agent/PilotSyncAgent.py index 386b6336862..718d84aecb8 100644 --- a/src/DIRAC/WorkloadManagementSystem/Agent/PilotSyncAgent.py +++ b/src/DIRAC/WorkloadManagementSystem/Agent/PilotSyncAgent.py @@ -98,7 +98,9 @@ def execute(self): self.log.info("Moving pilot files", f"to {self.saveDir}") for tf in allFiles: # this overrides the destinations - shutil.move(tf, os.path.join(self.saveDir, os.path.basename(tf))) + # use copy & remove rather than move to reset SELinux context on files + shutil.copy(tf, os.path.join(self.saveDir, os.path.basename(tf))) + os.remove(tf) # Here, attempting upload somewhere, and somehow for server in self.uploadLocations: