mirror of
https://github.com/rclone/rclone.git
synced 2025-12-06 00:03:32 +00:00
b2: Add new cleanup and cleanup-hidden backend commands.
This commit is contained in:
committed by
Nick Craig-Wood
parent
a24aeba495
commit
070cff8a65
@@ -179,14 +179,24 @@ using the `--b2-version-at` flag. This will show the file versions as they
|
||||
were at that time, showing files that have been deleted afterwards, and
|
||||
hiding files that were created since.
|
||||
|
||||
If you wish to remove all the old versions then you can use the
|
||||
`rclone cleanup remote:bucket` command which will delete all the old
|
||||
versions of files, leaving the current ones intact. You can also
|
||||
supply a path and only old versions under that path will be deleted,
|
||||
e.g. `rclone cleanup remote:bucket/path/to/stuff`.
|
||||
If you wish to remove all the old versions, and unfinished large file
|
||||
uploads, then you can use the `rclone cleanup remote:bucket` command
|
||||
which will delete all the old versions of files, leaving the current ones
|
||||
intact. You can also supply a path and only old versions under that path
|
||||
will be deleted, e.g. `rclone cleanup remote:bucket/path/to/stuff`.
|
||||
|
||||
Note that `cleanup` will remove partially uploaded files from the bucket
|
||||
if they are more than a day old.
|
||||
if they are more than a day old. If you want more control over the
|
||||
expiry date then run `rclone backend cleanup b2:bucket -o max-age=1h`
|
||||
to remove all unfinished large file uploads older than one hour, leaving
|
||||
old versions intact.
|
||||
|
||||
If you wish to remove all the old versions, leaving current files and
|
||||
unfinished large files intact, then you can use the
|
||||
[`rclone backend cleanup-hidden remote:bucket`](#cleanup-hidden)
|
||||
command. You can also supply a path and only old versions under that
|
||||
path will be deleted, e.g.
|
||||
`rclone backend cleanup-hidden remote:bucket/path/to/stuff`.
|
||||
|
||||
When you `purge` a bucket, the current and the old versions will be
|
||||
deleted then the bucket will be deleted.
|
||||
@@ -713,6 +723,42 @@ Options:
|
||||
- "daysFromHidingToDeleting": After a file has been hidden for this many days it is deleted. 0 is off.
|
||||
- "daysFromUploadingToHiding": This many days after uploading a file is hidden
|
||||
|
||||
### cleanup
|
||||
|
||||
Remove unfinished large file uploads.
|
||||
|
||||
rclone backend cleanup remote: [options] [<arguments>+]
|
||||
|
||||
This command removes unfinished large file uploads of age greater than
|
||||
max-age, which defaults to 24 hours.
|
||||
|
||||
Note that you can use --interactive/-i or --dry-run with this command to see what
|
||||
it would do.
|
||||
|
||||
rclone backend cleanup b2:bucket/path/to/object
|
||||
rclone backend cleanup -o max-age=7w b2:bucket/path/to/object
|
||||
|
||||
Durations are parsed as per the rest of rclone, 2h, 7d, 7w etc.
|
||||
|
||||
|
||||
Options:
|
||||
|
||||
- "max-age": Max age of upload to delete
|
||||
|
||||
### cleanup-hidden
|
||||
|
||||
Remove old versions of files.
|
||||
|
||||
rclone backend cleanup-hidden remote: [options] [<arguments>+]
|
||||
|
||||
This command removes any old hidden versions of files.
|
||||
|
||||
Note that you can use --interactive/-i or --dry-run with this command to see what
|
||||
it would do.
|
||||
|
||||
rclone backend cleanup-hidden b2:bucket/path/to/dir
|
||||
|
||||
|
||||
{{< rem autogenerated options stop >}}
|
||||
|
||||
## Limitations
|
||||
|
||||
Reference in New Issue
Block a user