问题
I want to transfer data from my cloud storage bucket to S3. I did a lot of research . I found an interesting article in which this can be done using gsutil command. Again it requires a manual activity. Is there any way to do this without any manual activity or like any possibility to run this gsutil command through Java API ?
I have created a VM instance on my Google cloud project.I have configured the boto file which has my AWS credentials.Using gsutil command I was able to copy my data from cloud storage to s3.I want to automate this step
回答1:
gsutil
can work with both Google Storage and S3.
gsutil rsync -d -r gs://my-gs-bucket s3://my-s3-bucket
You just need to configure it with both - Google and your AWS S3 credentials. gsutil would use credentials from ~/.boto file.
There are multiple ways to automate shell command execution. From Java's Runtime.exec() to Google Cloud Scheduler (your cloud's cron)
回答2:
Fully automated and easy to use way would be Google Storage Transfer. It would let you select the source and target buckets in either S3 or GCS and set shedule such as "run daily at 1am"
来源:https://stackoverflow.com/questions/56882228/how-to-transfer-data-from-google-cloud-storage-to-s3-without-any-manual-activity