Skip to content

Commit

Permalink
Add --exclude-if-uploaded-after sync option
Browse files Browse the repository at this point in the history
  • Loading branch information
ppolewicz committed Dec 17, 2024
1 parent 0fe3fe0 commit 2fe70c6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions b2/_internal/console_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -3007,6 +3007,8 @@ class Sync(
Ignored files or file versions will not be taken for consideration during sync.
The time should be given as a seconds timestamp (e.g. "1367900664")
If you need milliseconds precision, put it after the comma (e.g. "1367900664.152")
Alternatively you can specify ``--exclude-if-uploaded-after`` to use the server-side
object creation timestamp rather than the modification time declared by the client.
Files are considered to be the same if they have the same name
and modification time. This behaviour can be changed using the
Expand Down Expand Up @@ -3124,6 +3126,13 @@ def _setup_parser(cls, parser):
default=None,
metavar='TIMESTAMP'
)
add_normalized_argument(
parser,
'--exclude-if-uploaded-after',
type=parse_millis_from_float_timestamp,
default=None,
metavar='TIMESTAMP'
)
super()._setup_parser(parser) # add parameters from the mixins, and the parent class
parser.add_argument('source')
parser.add_argument('destination')
Expand Down Expand Up @@ -3217,6 +3226,7 @@ def get_policies_manager_from_args(self, args):
include_file_regexes=args.include_regex,
exclude_all_symlinks=args.exclude_all_symlinks,
exclude_modified_after=args.exclude_if_modified_after,
exclude_uploaded_after=args.exclude_if_uploaded_after,
)

def get_synchronizer_from_args(
Expand Down
1 change: 1 addition & 0 deletions changelog.d/+9092be80.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `--exclude-if-uploaded-after` to `sync`.

0 comments on commit 2fe70c6

Please sign in to comment.