This commit is contained in:
parent
8e82650b96
commit
772700f039
@ -89,6 +89,12 @@ if __name__ == "__main__":
|
||||
parser.add_argument('action', nargs="?")
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.action == "env":
|
||||
print("# source this to use kopia with this repo")
|
||||
for k,v in ENV.items():
|
||||
print(f"export {k}=\"{v}\"")
|
||||
sys.exit(0)
|
||||
else:
|
||||
res_init = init(mode="s3", bucket="kopia", prefix="{{ name }}", gateway="{{ kopia.repos[params.repo].gateway|default('gateway.storjshare.io') }}", region="{{ kopia.repos[params.repo].region|default('EU1') }}", ak="{{ kopia.repos[params.repo].ak }}", sak="{{ kopia.repos[params.repo].sak }}")
|
||||
if not res_init:
|
||||
print("init error")
|
||||
@ -104,9 +110,6 @@ if __name__ == "__main__":
|
||||
if not run(before_tasks={{ params.before_tasks|default([]) }}):
|
||||
print("run error")
|
||||
sys.exit(1)
|
||||
elif args.action == "env":
|
||||
print("# source this to use kopia with this repo")
|
||||
for k,v in ENV.items():
|
||||
print(f"export {k}=\"{v}\"")
|
||||
else:
|
||||
list_snapshots()
|
||||
sys.exit(0)
|
||||
|
Loading…
Reference in New Issue
Block a user