Operations¶
Data synchronization operations.
sync_data ¶
sync_data(
source_path,
destination_path,
source_path_prefix=None,
filter_config=None,
filter_root=None,
max_concurrency=10,
retain_source_data=True,
delete=True,
require_lock=False,
force=False,
size_only=False,
fail_if_missing=True,
remote_to_local_config=None,
include_detailed_response=False,
)
Sync data from a source path to a destination path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_path
|
S3Path | LocalPath
|
Path to sync data from. |
required |
destination_path
|
S3Path | LocalPath
|
Path to sync data to. |
required |
source_path_prefix
|
str | None
|
Optional S3 key prefix scoping the source. |
None
|
filter_config
|
DataSyncFilterConfig | None
|
Optional include/exclude filters describing what to move. Not supported for local -> local syncs, which warn and copy in full. |
None
|
filter_root
|
str | None
|
Root that filter patterns are matched relative to. Defaults to the source path; set explicitly when syncing a sub-prefix of the root the patterns were written against. |
None
|
max_concurrency
|
int
|
Maximum number of concurrent transfer operations. |
10
|
retain_source_data
|
bool
|
Whether to keep source data after syncing. |
True
|
delete
|
bool
|
Whether to delete destination paths absent from the (filtered)
source. Note that this combines destructively with |
True
|
require_lock
|
bool
|
Whether to acquire a lock on the destination path. |
False
|
force
|
bool
|
Whether to transfer regardless of existing destination content. |
False
|
size_only
|
bool
|
Whether to compare only file sizes when deciding to transfer. |
False
|
fail_if_missing
|
bool
|
Whether to raise if the source path does not exist. |
True
|
remote_to_local_config
|
RemoteToLocalConfig | None
|
Options specific to remote-to-local syncs. |
None
|
include_detailed_response
|
bool
|
Whether to compute detailed transfer metrics. |
False
|
Returns:
| Type | Description |
|---|---|
|
The sync result. |
Source code in src/aibs_informatics_aws_utils/data_sync/operations.py
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 | |