skip to Main Content

Good day

I want to pass the value of $mm to this azcopy. However, since azcopy parameters are in double quotes, it does not want to process correctly.

 $mm=04 ; start=`echo "START DATE: $(date)"` ; azcopy cp "https://reco.blob.core.windows.net/raw-voi-2022/2022-$mm/*?sv=2020-0RgUNH8A%3D" "https://storage.blob.core.windows.net/bin-voi-2022/2022-$mm?sv=2021-0HGICxvaLULI%3D"

Results:

Job 24fa36ea-8bda-cc4f-632a-07db4d922036 has started
Log file is located at: /log/azcopy/24fa36ea-8bda-cc4f-632a-07db4d922036.log

100.0 %, 0 Done, 0 Failed, 0 Pending, 0 Skipped, 0 Total,

                                                                                                                                                                                          Job 24fa36ea-8bda-cc4f-632a-07db4d922036 summary                                                                                                                                          Elapsed Time (Minutes): 0.0333
Number of File Transfers: 0
Number of Folder Property Transfers: 0
Number of Symlink Transfers: 0
Total Number of Transfers: 0
Number of File Transfers Completed: 0
Number of Folder Transfers Completed: 0
Number of File Transfers Failed: 0
Number of Folder Transfers Failed: 0
Number of File Transfers Skipped: 0
Number of Folder Transfers Skipped: 0
TotalBytesTransferred: 0
Final Job Status: Completed

Thank you.

2

Answers


  1. Chosen as BEST ANSWER

    When you are in a Linux os, don't use $ to declare a variable.

    # mm=10 ; start=`echo "START DATE: $(date)"` ; azcopy --overwrite=false cp "https://reco.blob.core.windows.net/raw-scr-2022/2022-$mm/*?sv=2021-11gLGKAJj3mMT8%3D" "https://storage.blob.core.windows.net/bin-scr-2022/2022-$mm?sv=2021-10sDQ%3D" ; end=`echo "END DATE: $(date)"`;  echo $start ; echo $end
    INFO: Scanning...
    INFO: Failed to create one or more destination container(s). Your transfers may still succeed if the container already exists.
    INFO: Any empty folders will not be processed, because source and/or destination doesn't have full folder support
    
    Job 5b0aa50e-d718-0142-72da-7be5962e3a5f has started
    Log file is located at: /log/azcopy/5b0aa50e-d718-0142-72da-7be5962e3a5f.log
    
    49.2 %, 60467 Done, 656 Failed, 58877 Pending, 0 Skipped, 120000 Total (scanning...), 2-sec Throughput (Mb/s): 57442.6611 (Service may be limiting speed)
    

  2. I have summarized our discussion and posting the above comment as an answer.

    Since you are running the above cmdlet in Linux, you need to initialize the variable with as mm=04 instead of using $mm=04

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search