1

Can anyone give advice on debugging why this command isn't working on MacOS Catalina?

~ $ gsutil cp -r gs://elium/photo.video/ /Users/alex -v
CommandException: Destination URL must name a directory, bucket, or bucket
subdirectory for the multiple source form of the cp command.
  • /Users/alex is definitely an existing folder
2
  • This might be better off at superuser.com or Unix & Linux Commented Aug 25, 2021 at 21:23
  • 1
    Are you trying to download files or copy between buckets? What are you expecting the ending -v to do because that is definitely not a folder Commented Aug 25, 2021 at 21:24

2 Answers 2

4

You have the token -v at the end of your command, and gsutil thinks that is the destination path. When you provide multiple args to gsutil cp, it thinks all args except the last arg are sources (the objects/files to be copied), and the last arg is the destination (the folder/bucket to copy the files into).

The -v flag should go before all of your non-flag arguments. Try using cp -r -v.

1

@mhouglum was right!

Also, I'll add that the trailing slash in the source URL broke things silently. (I ran the command but got no output) The final working cmd was:

gsutil cp -r -v gs://elium/photo.video /Users/alex

Not the answer you're looking for? Browse other questions tagged or ask your own question.