Last active
February 17, 2020 14:22
-
-
Save joseluisq/cdbaff8e79f31b7eeaec25d8679ec5dc to your computer and use it in GitHub Desktop.
Testing download file speed using cUrl and get its stats into a log file. Unix-like systems only.
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 | |
# For customize the writeout take a look at https://ec.haxx.se/usingcurl/usingcurl-verbose/usingcurl-writeout | |
curl -Skw "\ | |
CURL download file testing\n\ | |
==========================\n\ | |
URL: %{url_effective}\n\ | |
Response code: %{response_code}\n\ | |
Download size: %{size_download}B\n\ | |
Download speed: %{speed_download}B/s\n\ | |
Time connect: %{time_connect}s\n\ | |
Time name lookup: %{time_namelookup}s\n\ | |
Time pretransfer: %{time_pretransfer}\n\ | |
Time start transfer: %{time_starttransfer}s\n\ | |
Time redirect: %{time_redirect}s\n\ | |
Time total: %{time_total}s\n" \ | |
-Lo /dev/null \ | |
--url $1 \ | |
> download_testing_stats.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Script usage
Downloaded stats content will be placed into a
download_testing_stats.log
.chmod +x download_testing_stats.sh ./download_testing_stats.sh "https://ger.mirror.pkgbuild.com/iso/2020.02.01/archlinux-2020.02.01-x86_64.iso"
Note:
/dev/null
with the corresponding file path on system.