diff --git a/sdcm/logcollector.py b/sdcm/logcollector.py index a767149972..c5b5aa8692 100644 --- a/sdcm/logcollector.py +++ b/sdcm/logcollector.py @@ -597,7 +597,7 @@ def create_remote_storage_dir(self, node, path=''): def collect_log_remotely(node, cmd: str, log_filename: str) -> Optional[str]: if not node.remoter: return None - collect_log_command = f"{cmd} >& '{log_filename}'" + collect_log_command = f"{cmd} > '{log_filename}' 2>&1" node.remoter.run(collect_log_command, ignore_status=True, verbose=True) result = node.remoter.run(f"test -f '{log_filename}'", ignore_status=True) return log_filename if result.ok else None