Skip to content

Commit db262a1

Browse files
authored
Merge pull request #26 from lilab-bcb/fix-rsync
Fix issue with sync command in local backend
2 parents 42de52c + 9ed465e commit db262a1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

strato/backends/_local.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,17 @@ def copy(self, recursive, ionice, filenames, quiet, dryrun):
5656
def sync(self, ionice, source, target, quiet, dryrun):
5757
if shutil.which("rsync") is None:
5858
raise Exception("rsync is not installed!")
59-
target = os.path.dirname(target)
59+
# target = os.path.dirname(target)
60+
os.makedirs(target, exist_ok=True)
6061
call_args = (
6162
["ionice", "-c", "2", "-n", "7"]
6263
if ionice and (shutil.which("ionice")) is not None
6364
else []
6465
)
66+
if not source.endswith("/"):
67+
source += "/"
68+
if not target.endswith("/"):
69+
target += "/"
6570
call_args += ["rsync", "-r", "--delete", source, target]
6671
if not quiet or dryrun:
6772
print(" ".join(call_args))

0 commit comments

Comments
 (0)