From 69dcebdae582ea25660d337f1aee8a16b3d5e48a Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Mon, 26 Feb 2024 18:35:12 -0800 Subject: [PATCH 1/2] Prevent double '//' in case of root folder --- rsync_time_machine.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rsync_time_machine.py b/rsync_time_machine.py index 300143b..1dcbd31 100755 --- a/rsync_time_machine.py +++ b/rsync_time_machine.py @@ -757,9 +757,15 @@ def start_backup( if ssh is not None: src_folder = f"{ssh.src_folder_prefix}{src_folder}" dest = f"{ssh.dest_folder_prefix}{dest}" + + if src_folder != "/": + src_folder = f"{src_folder}/" + if dest != "/": + dest = f"{dest}/" + log_info(style("Starting backup...", "yellow")) - log_info(f"From: {style(src_folder, bold=True)}/") - log_info(f"To: {style(dest, bold=True)}/") + log_info(f"From: {style(src_folder, bold=True)}") + log_info(f"To: {style(dest, bold=True)}") cmd = "rsync" if ssh is not None: @@ -772,7 +778,7 @@ def start_backup( cmd = f"{cmd} --exclude-from '{exclusion_file}'" cmd = f"{cmd} {link_dest_option}" - cmd = f"{cmd} -- '{src_folder}/' '{dest}/'" + cmd = f"{cmd} -- '{src_folder}' '{dest}'" log_info(style("Running command:", bold=True)) log_info(style(cmd, "green")) From 26468532948b2b1d4e47d6c43ae91e7d8489f530 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Mon, 26 Feb 2024 18:39:09 -0800 Subject: [PATCH 2/2] Increase streaming limit --- rsync_time_machine.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rsync_time_machine.py b/rsync_time_machine.py index 1dcbd31..bb43857 100755 --- a/rsync_time_machine.py +++ b/rsync_time_machine.py @@ -386,12 +386,14 @@ async def async_run_cmd( f"{ssh.cmd} '{cmd}'", stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE, + limit=2**19, # default is 2**16 = 64 KiB ) else: process = await asyncio.create_subprocess_shell( cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE, + limit=2**19, # default is 2**16 = 64 KiB ) # Should not be None because of asyncio.subprocess.PIPE