GoogleCloudPlatform / gsutil

A command line tool for interacting with cloud storage services.
Apache License 2.0
873 stars 333 forks source link

Not able to use gsutil rsync to sync local dir to s3 bucket #1738

Open dineshkumar3234 opened 1 year ago

dineshkumar3234 commented 1 year ago

ubuntu@newhost:~/data$ gsutil -m rsync -r global s3://ax-global **CommandException: The rsync command requires at least 2 arguments. Usage:

gsutil rsync [OPTION]... src_url dst_url**

For additional help run: gsutil help rsync ubuntu@newhost:~/data$

i am able to list the buckets folder with gsutil ls s3://ax-global

Used cmd: gsutil -m rsync -r global s3://ax-global gsutil -m rsync -ri global s3://ax-global gsutil rsync -r global s3://ax-global gsutil rsync global s3://ax-global gsutil rsync ./global s3://ax-global gsutil -m rsync -r ./global s3://ax-global/ gsutil rsync ./global s3://ax-global/

adamsh231 commented 1 year ago

i got this error too with similar case with you

my command

gsutil -m rsync -r s3://my-source-bucket gs://my-destination-bucket

got similar error above (**CommandException: The rsync command requires at least 2 arguments. Usage: xxx)

i tried to check whats wrong with the rsync command argument, so i tried to sync my local directory in order to check my argument with this command

gsutil -m rsync -r /home/{user}/test/ gs://my-destination-bucket

its running well

so i try again once more with spesific folder img but this time with bucket

gsutil -m rsync -r s3://my-source-bucket/img gs://my-destination-bucket

and gotcha it worked

so i try to add slash, you may add /. it will be s3://my-source-bucket/ not s3://my-source-bucket

gsutil -m rsync -r s3://my-source-bucket/ gs://my-destination-bucket

Hope this helps