Copy a folder from s3 bucket to a network drive

0

Trying to copy a folder from s3 bucket to a network drive on my computer G, into a folder DBA_TEAM, I get an error

PS H:\PRODUCTION_WORK\AWSMIGRATION\CommandLineInterface> aws s3 cp –recursive s3://ojp-forecaster-01/NONCLOBBLOB/GMSG2K/ G:/DBA_TEAM

aws : At line:2 char:1

  • aws s3 cp –recursive s3://ojp-forecaster-01/NONCLOBBLOB/GMSG2K/ G:/DB ...
  •   + CategoryInfo          : NotSpecified: (:String) [], RemoteException
      + FullyQualifiedErrorId : NativeCommandError
    

Unknown options: G:/DBA_TEAM

PS H:\PRODUCTION_WORK\AWSMIGRATION\CommandLineInterface> aws s3 cp –R s3://ojp-forecaster-01/NONCLOBBLOB/GMSG2K/ G:/DBA_TEAM

aws : At line:2 char:1

  • aws s3 cp –R s3://ojp-forecaster-01/NONCLOBBLOB/GMSG2K/ G:/DBA_TEAM
  •   + CategoryInfo          : NotSpecified: (:String) [], RemoteException
      + FullyQualifiedErrorId : NativeCommandError
    

Unknown options: G:/DBA_TEAM

whereas as when I copy an individual file from the folder it works

PS H:\PRODUCTION_WORK\AWSMIGRATION\CommandLineInterface> aws s3 cp s3://ojp-forecaster-01/NONCLOBBLOB/GMSG2K/CCR_REGISTRATION_CLAIM/LOAD00000001.csv G:\DBA_TEAM\FlatFile\nonclob\CCR_REGISTRATION_CLAIM

Completed 256.0 KiB/6.4 MiB (171.9 KiB/s) with 1 file(s) remaining Completed 512.0 KiB/6.4 MiB (235.4 KiB/s) with 1 file(s) remaining Completed 768.0 KiB/6.4 MiB (280.9 KiB/s) with 1 file(s) remaining Completed 1.0 MiB/6.4 MiB (317.9 KiB/s) with 1 file(s) remaining
Completed 1.2 MiB/6.4 MiB (351.7 KiB/s) with 1 file(s) remaining
Completed 1.5 MiB/6.4 MiB (384.0 KiB/s) with 1 file(s) remaining
Completed 1.8 MiB/6.4 MiB (412.0 KiB/s) with 1 file(s) remaining
Completed 2.0 MiB/6.4 MiB (437.1 KiB/s) with 1 file(s) remaining
Completed 2.2 MiB/6.4 MiB (457.6 KiB/s) with 1 file(s) remaining
Completed 2.5 MiB/6.4 MiB (481.7 KiB/s) with 1 file(s) remaining
Completed 2.8 MiB/6.4 MiB (503.5 KiB/s) with 1 file(s) remaining
Completed 3.0 MiB/6.4 MiB (522.9 KiB/s) with 1 file(s) remaining
Completed 3.2 MiB/6.4 MiB (541.1 KiB/s) with 1 file(s) remaining
Completed 3.5 MiB/6.4 MiB (563.3 KiB/s) with 1 file(s) remaining
Completed 3.8 MiB/6.4 MiB (578.3 KiB/s) with 1 file(s) remaining
Completed 4.0 MiB/6.4 MiB (597.7 KiB/s) with 1 file(s) remaining
Completed 4.2 MiB/6.4 MiB (616.2 KiB/s) with 1 file(s) remaining
Completed 4.5 MiB/6.4 MiB (628.2 KiB/s) with 1 file(s) remaining
Completed 4.8 MiB/6.4 MiB (644.7 KiB/s) with 1 file(s) remaining
Completed 5.0 MiB/6.4 MiB (660.4 KiB/s) with 1 file(s) remaining
Completed 5.2 MiB/6.4 MiB (680.4 KiB/s) with 1 file(s) remaining
Completed 5.5 MiB/6.4 MiB (694.7 KiB/s) with 1 file(s) remaining
Completed 5.8 MiB/6.4 MiB (713.7 KiB/s) with 1 file(s) remaining
Completed 6.0 MiB/6.4 MiB (727.1 KiB/s) with 1 file(s) remaining
Completed 6.2 MiB/6.4 MiB (745.1 KiB/s) with 1 file(s) remaining
Completed 6.4 MiB/6.4 MiB (755.0 KiB/s) with 1 file(s) remaining
download: s3://ojp-forecaster-01/NONCLOBBLOB/GMSG2K/CCR_REGISTRATION_CLAIM/LOAD00000001.csv to G:\DBA_TEAM\FlatFile\nonclob\CCR_REGISTRATION_CLAIM\LOAD00000001.csv

How do I copy the entire folder on to my network drive G, I can copy a file biut the folder gives and error, all the help will be appreciated

1 Risposta
0
Risposta accettata

Hi, From https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3/cp.html, it seems that --recursive should come after the 2 paths not before.

Also see examples at https://www.learnaws.org/2022/03/01/aws-s3-cp-recursive/

profile pictureAWS
ESPERTO
con risposta un anno fa
profile picture
ESPERTO
verificato un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande