You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently think it is a non-goal to manage folder syncing behind the scenes, but we might want to explicitly support it as a method.
For example, something like:
# I have a local folder that has many changes in it, including file deletionslocal_changes="/work_in_progress"# copies cloud versions down to disk, but skips dl'ing where possible; deletes extra files locallyS3Path("s3://bucket/project_storage").sync_down(local_changes)
# copies local versions up to cloud, but skips ul'ing where possible; deletes extra files on the cloudS3Path("s3://bucket/project_storage").sync_up(local_changes)
@pjbull any news about this one...? would love to see this feature; specifically, I think it would be nice to allow syncing to/from the path _local attribute...
Thanks @noamgot. I think we're unlikely to add this in the near term since it is out of scope for the project given the number of scenarios to support.
We should provide the building blocks for cloudpathlib users to write a sync function that works for their scenario:
CloudPath.download_to will always overwrite local with what is on the cloud
CloudPath.upload_from will always overwrite cloud the cloud with what is local
Otherwise, globbing both dirs with .realtive_to will let you (1) skip things that exist already, (2) delete any extra files from one side or the other of the sync.
For two-way sync scenarios, you need to decide for yourself what determines which file is canonical (modified time? be careful of timestamp resolution and time zones; etags? you need to track those locally for yourself; file hashes? you need to calculate for local (and cloud if not provided by the backend)).
Activity
ypicard commentedon Jan 30, 2022
This is the last missing piece that will make me migrate to this library. I would really appreciate this being a thing indeed.
pjbull commentedon Dec 19, 2022
Additional discussion in #134.
noamgot commentedon Nov 30, 2025
@pjbull any news about this one...? would love to see this feature; specifically, I think it would be nice to allow syncing to/from the path
_localattribute...pjbull commentedon Dec 2, 2025
Thanks @noamgot. I think we're unlikely to add this in the near term since it is out of scope for the project given the number of scenarios to support.
We should provide the building blocks for cloudpathlib users to write a sync function that works for their scenario:
CloudPath.download_towill always overwrite local with what is on the cloudCloudPath.upload_fromwill always overwrite cloud the cloud with what is local.realtive_towill let you (1) skip things that exist already, (2) delete any extra files from one side or the other of the sync.