Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload time tweaks #1061

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 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 Expand Up @@ -3569,8 +3579,6 @@ class FileUploadBase(UploadFileMixin, UploadModeMixin, Command):
The ``--custom-upload-timestamp``, in milliseconds-since-epoch, can be used
to artificially change the upload timestamp of the file for the purpose
of preserving retention policies after migration of data from other storage.
The access to this feature is restricted - if you really need it, you'll
need to contact customer support to enable it temporarily for your account.

Requires capability:

Expand Down Expand Up @@ -3629,8 +3637,6 @@ class UploadUnboundStreamBase(UploadFileMixin, Command):
The ``--custom-upload-timestamp``, in milliseconds-since-epoch, can be used
to artificially change the upload timestamp of the file for the purpose
of preserving retention policies after migration of data from other storage.
The access to this feature is restricted - if you really need it, you'll
need to contact customer support to enable it temporarily for your account.

Requires capability:

Expand Down
1 change: 1 addition & 0 deletions changelog.d/+48cc3755.removed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove a note about --custom-upload-timestamp being restricted now that it's Generally Available.
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`.
Loading