Skip to content

Commit

Permalink
Merge pull request #26 from lilab-bcb/fix-rsync
Browse files Browse the repository at this point in the history
Fix issue with sync command in local backend
  • Loading branch information
yihming authored May 29, 2024
2 parents 42de52c + 9ed465e commit db262a1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion strato/backends/_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,17 @@ def copy(self, recursive, ionice, filenames, quiet, dryrun):
def sync(self, ionice, source, target, quiet, dryrun):
if shutil.which("rsync") is None:
raise Exception("rsync is not installed!")
target = os.path.dirname(target)
# target = os.path.dirname(target)
os.makedirs(target, exist_ok=True)
call_args = (
["ionice", "-c", "2", "-n", "7"]
if ionice and (shutil.which("ionice")) is not None
else []
)
if not source.endswith("/"):
source += "/"
if not target.endswith("/"):
target += "/"
call_args += ["rsync", "-r", "--delete", source, target]
if not quiet or dryrun:
print(" ".join(call_args))
Expand Down

0 comments on commit db262a1

Please sign in to comment.