-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathupload
More file actions
executable file
·20 lines (13 loc) · 939 Bytes
/
upload
File metadata and controls
executable file
·20 lines (13 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# get the current resource group name
resource_group_name=$(ibmcloud target -o JSON | jq -r '.resource_group.name')
cos_instance=${resource_group_name/--rg/}--cos
echo "switching to COS instance $cos_instance"
# configure the COS instance
crn=$(ibmcloud resource service-instance "${cos_instance}" -o json | jq -r '.[] | .crn')
ibmcloud cos config crn --crn $crn --force
# get the bucket names
output_bucket=$(ibmcloud cos buckets --json | jq -r '.Buckets[] | select( .Name | contains("output")) | .Name')
input_bucket=$(ibmcloud cos buckets --json | jq -r '.Buckets[] | select( .Name | contains("input")) | .Name')
rclone --config .rclone_${resource_group_name}.conf sync data/input s3:${input_bucket} --progress --multi-thread-streams=16 --checkers=32 --transfers=8
rclone --config .rclone_${resource_group_name}.conf sync data/output s3:${output_bucket} --progress --multi-thread-streams=16 --checkers=32 --transfers=8