знаете ли вы, можно ли удалить сохранение корзины, включая любую вложенную папку в ней?
Я пробовал использовать параметр -m, и он включает только объекты (файлы), но не подпапки и объекты внутри этих подпапок, что на самом деле то, что я хочу:
gsutil -m retention event release gs://mybucket/input/*
Я получаю следующее:
Omitting prefix "gs://mybucket/input/fromkafka-05df04d2-1148-4266-857b-7bba574b2f17/_temporary/0/_temporary/attempt_20200803174938_11051_r_000000_0/". (Did you mean to do retention -r?)
Omitting prefix "gs://mybucket/input/fromkafka-05df04d2-1148-4266-857b-7bba574b2f17/_temporary/0/_temporary/attempt_20200803174938_11051_r_000000_1/". (Did you mean to do retention -r?)
Omitting prefix "gs://mybucket/input/fromkafka-05df04d2-1148-4266-857b-7bba574b2f17/_temporary/0/_temporary/attempt_20200803174938_11051_r_000000_2/". (Did you mean to do retention -r?)
Omitting prefix "gs://mybucket/input/fromkafka-05df04d2-1148-4266-857b-7bba574b2f17/_temporary/0/_temporary/attempt_20200803174938_11051_r_000000_3/". (Did you mean to do retention -r?)
Omitting prefix "gs://mybucket/input/fromkafka-05df04d2-1148-4266-857b-7bba574b2f17/_temporary/0/_temporary/attempt_20200803174938_11051_r_000001_0/". (Did you mean to do retention -r?)
Omitting prefix "gs://mybucket/input/fromkafka-05df04d2-1148-4266-857b-7bba574b2f17/_temporary/0/_temporary/attempt_20200803174938_11051_r_000001_1/". (Did you mean to do retention -r?)
Omitting prefix "gs://mybucket/input/fromkafka-05df04d2-1148-4266-857b-7bba574b2f17/_temporary/0/_temporary/attempt_20200803174938_11051_r_000001_2/". (Did you mean to do retention -r?)
Omitting prefix "gs://mybucket/input/fromkafka-05df04d2-1148-4266-857b-7bba574b2f17/_temporary/0/_temporary/attempt_20200803174938_11051_r_000001_3/". (Did you mean to do retention -r?)
И я также пытался использовать эту опцию -r, но получаю это:
gsutil -r retention event release gs://mybucket/*
Traceback (most recent call last):
File "/usr/lib/google-cloud-sdk/platform/gsutil/gslib/utils/arg_helper.py", line 35, in GetArgumentsAndOptions
'testexceptiontraces', 'trace-token=', 'perf-trace-token='
File "/usr/lib/python3.7/getopt.py", line 95, in getopt
opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])
File "/usr/lib/python3.7/getopt.py", line 195, in do_shorts
if short_has_arg(opt, shortopts):
File "/usr/lib/python3.7/getopt.py", line 211, in short_has_arg
raise GetoptError(_('option -%s not recognized') % opt, opt)
getopt.GetoptError: option -r not recognized
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/google-cloud-sdk/platform/gsutil/gslib/__main__.py", line 65, in <module>
opts, args = GetArgumentsAndOptions()
File "/usr/lib/google-cloud-sdk/platform/gsutil/gslib/utils/arg_helper.py", line 38, in GetArgumentsAndOptions
raise CommandException(e.msg)
gslib.exception.CommandException: CommandException: option -r not recognized
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/google-cloud-sdk/platform/gsutil/gsutil", line 21, in <module>
gsutil.RunMain()
File "/usr/lib/google-cloud-sdk/platform/gsutil/gsutil.py", line 122, in RunMain
import gslib.__main__
File "/usr/lib/google-cloud-sdk/platform/gsutil/gslib/__main__.py", line 67, in <module>
reason = e.reason if e.information else 'CommandException: %s' % e.reason
AttributeError: 'CommandException' object has no attribute 'information'