Created
October 1, 2020 19:50
-
-
Save aessing/76f1200c9f5b2b9671937b3b0ed5fd6f to your computer and use it in GitHub Desktop.
Install AzCopy on Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ============================================================================= | |
# Install AzCopy on Linux | |
# https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10 | |
# https://github.com/Azure/azure-storage-azcopy | |
# ----------------------------------------------------------------------------- | |
# Developer.......: Andre Essing (https://www.andre-essing.de/) | |
# (https://github.com/aessing) | |
# (https://twitter.com/aessing) | |
# (https://www.linkedin.com/in/aessing/) | |
# ----------------------------------------------------------------------------- | |
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, | |
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED | |
# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. | |
# ============================================================================= | |
# Download and extract | |
wget https://aka.ms/downloadazcopy-v10-linux | |
tar -xvf downloadazcopy-v10-linux | |
# Move AzCopy | |
sudo rm -f /usr/bin/azcopy | |
sudo cp ./azcopy_linux_amd64_*/azcopy /usr/bin/ | |
sudo chmod 755 /usr/bin/azcopy | |
# Clean the kitchen | |
rm -f downloadazcopy-v10-linux | |
rm -rf ./azcopy_linux_amd64_*/ |
I agree with @aessing (thanks Andre!) for the script. Keeping the gist as separate lines is good for readability. People who want the oneliners can use those, but good that the gist is in separate lines.
curl -L https://aka.ms/downloadazcopy-v10-linux | sudo tar --strip-components=1 -C /usr/local/bin --no-same-owner --exclude=*.txt -xzvf -| sudo chmod 755 /usr/local/bin/azcopy
aaand the final chmod to actually use this as non root ;)
Use quotes on "*.txt"
to run it inside zsh
curl -L https://aka.ms/downloadazcopy-v10-linux | sudo tar --strip-components=1 -C /usr/local/bin --no-same-owner --exclude="*.txt" -xzvf - | sudo chmod 755 /usr/local/bin/azcopy
Thanks @rzewus and thanks @SolomidHero for your suggestions and help getting my code into a one-liner.
Love it
azcopy can now be installed via apt/dnf/etc.
https://github.com/Azure/azure-storage-azcopy/releases/tag/v10.26.0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome @orgads, Thank you!