file update

Update file settings.

Setting legal holds only works in bucket with fileLockEnabled=true.

Retention:

Only works in bucket with fileLockEnabled=true. Providing a retention-mode other than none requires providing retainUntil, which has to be a future timestamp in the form of an integer representing milliseconds since epoch.

If a file already is in governance mode, disabling retention or shortening it’s period requires providing --bypass-governance.

If a file already is in compliance mode, disabling retention or shortening it’s period is impossible.

In both cases prolonging the retention period is possible. Changing from governance to compliance is also supported.

Warning

Setting file retention mode to ‘compliance’ is irreversible - such files can only be ever deleted after their retention period passes, regardless of keys (master or not) used. This is especially dangerous when setting bucket default retention, as it may lead to high storage costs.

Requires capability:

  • readFiles

  • writeFileLegalHolds (if updating legal holds)

  • writeFileRetentions (if updating retention)

  • bypassGovernance (if –bypass-governance is used)

b2 file update [-h] [--legal-hold {on,off}]
               [--file-retention-mode {compliance,governance,none}]
               [--retain-until TIMESTAMP] [--bypass-governance]
               B2_URI

Positional Arguments

B2_URI

B2 URI pointing to a file, e.g. b2://yourBucket/file.txt or b2id://fileId

Named Arguments

--legal-hold

Possible choices: on, off

--file-retention-mode

Possible choices: compliance, governance, none

--retain-until
--bypass-governance

Default: False