mirror of
https://github.com/imjasonh/gcloud-help
synced 2026-07-13 16:37:00 +00:00
gcloud: Wed Aug 27 10:57:46 UTC 2025
This commit is contained in:
parent
470b35e498
commit
93c043aaa0
176 changed files with 5452 additions and 264 deletions
|
|
@ -4,7 +4,9 @@ NAME
|
|||
SYNOPSIS
|
||||
gcloud storage restore [URLS ...] [--all-versions, -a] [--async]
|
||||
[--[no-]preserve-acl, -p] [--read-paths-from-stdin, -I]
|
||||
[--allow-overwrite --deleted-after-time=DELETED_AFTER_TIME
|
||||
[--allow-overwrite --created-after-time=CREATED_AFTER_TIME
|
||||
--created-before-time=CREATED_BEFORE_TIME
|
||||
--deleted-after-time=DELETED_AFTER_TIME
|
||||
--deleted-before-time=DELETED_BEFORE_TIME]
|
||||
[--if-generation-match=GENERATION
|
||||
--if-metageneration-match=METAGENERATION] [GCLOUD_WIDE_FLAG ...]
|
||||
|
|
@ -19,49 +21,74 @@ EXAMPLES
|
|||
|
||||
$ gcloud storage restore gs://bucket#123
|
||||
|
||||
Restore several soft-deleted buckets with generations:
|
||||
Restore several soft-deleted buckets with generations:
|
||||
|
||||
$ gcloud storage restore gs://bucket1#123 gs://bucket2#456
|
||||
|
||||
Restore latest soft-deleted version of object in a bucket.
|
||||
Restore latest soft-deleted version of object in a bucket.
|
||||
|
||||
$ gcloud storage restore gs://bucket/file1.txt
|
||||
|
||||
Restore a specific soft-deleted version of object in a bucket by specifying
|
||||
the generation.
|
||||
Restore a specific soft-deleted version of object in a bucket by specifying the generation.
|
||||
|
||||
$ gcloud storage restore gs://bucket/file1.txt#123
|
||||
|
||||
Restore all soft-deleted versions of object in a bucket.
|
||||
Restore all soft-deleted versions of object in a bucket.
|
||||
|
||||
$ gcloud storage restore gs://bucket/file1.txt --all-versions
|
||||
|
||||
Restore several objects in a bucket (with or without generation):
|
||||
Restore several objects in a bucket (with or without generation):
|
||||
|
||||
$ gcloud storage restore gs://bucket/file1.txt \
|
||||
gs://bucket/file2.txt#456
|
||||
gs://bucket/file2.txt#456
|
||||
|
||||
Restore the latest soft-deleted version of all text objects in a bucket:
|
||||
Restore the latest soft-deleted version of all text objects in a bucket:
|
||||
|
||||
$ gcloud storage restore gs://bucket/**.txt
|
||||
|
||||
Restore a list of objects read from stdin (with or without generation):
|
||||
Restore a list of objects read from stdin (with or without generation):
|
||||
|
||||
$ cat list-of-files.txt | gcloud storage restore \
|
||||
--read-paths-from-stdin
|
||||
--read-paths-from-stdin
|
||||
|
||||
Restore object with its original ACL policy:
|
||||
Restore object with its original ACL policy:
|
||||
|
||||
$ gcloud storage restore gs://bucket/file1.txt --preserve-acl
|
||||
|
||||
Restore all objects in a bucket asynchronously:
|
||||
Restore all objects in a bucket asynchronously:
|
||||
|
||||
$ gcloud storage restore gs://bucket/** --async
|
||||
|
||||
Restore all text files in a bucket asynchronously:
|
||||
Restore all text files in a bucket asynchronously:
|
||||
|
||||
$ gcloud storage restore gs://bucket/**.txt --async
|
||||
|
||||
Restore objects created within a specific time range:
|
||||
|
||||
$ gcloud storage restore gs://bucket/** --async \
|
||||
--created-after-time="2023-01-01T00:00:00Z" \
|
||||
--created-before-time="2023-01-31T23:59:59Z"
|
||||
|
||||
Restore objects soft-deleted within a specific time range:
|
||||
|
||||
$ gcloud storage restore gs://bucket/** --async \
|
||||
--deleted-after-time="2023-01-01T00:00:00Z" \
|
||||
--deleted-before-time="2023-01-31T23:59:59Z"
|
||||
|
||||
Restore objects using a combination of creation and deletion time filters:
|
||||
|
||||
$ gcloud storage restore gs://bucket/** --async --allow-overwrite \
|
||||
--created-after-time="2023-01-01T00:00:00Z" \
|
||||
--deleted-after-time="2023-01-01T00:00:00Z"
|
||||
|
||||
This command filters the objects that were live at 2023-01-01T00:00:00Z
|
||||
and then soft-deleted afterwards.
|
||||
|
||||
This combination of filters is especially helpful if there is a period of
|
||||
erroneous overwrites. They allow you to go back to the point just before
|
||||
the overwrites began. You will also need to set the --allow-overwrite
|
||||
option to true.
|
||||
|
||||
POSITIONAL ARGUMENTS
|
||||
[URLS ...]
|
||||
The url of objects to list.
|
||||
|
|
@ -104,6 +131,12 @@ FLAGS
|
|||
enabled, this will result in a noncurrent object. If versioning is
|
||||
not enabled, this will result in a soft-deleted object.
|
||||
|
||||
--created-after-time=CREATED_AFTER_TIME
|
||||
Restores only the objects that were created after this time.
|
||||
|
||||
--created-before-time=CREATED_BEFORE_TIME
|
||||
Restores only the objects that were created before this time.
|
||||
|
||||
--deleted-after-time=DELETED_AFTER_TIME
|
||||
Restores only the objects that were soft-deleted after this time.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue