- Author:
Ryan Fitton <[email protected]>
- Version:
1.0.0
- Date:
21/01/2019
- Switch to the
root
user:
sudo su
- Install
speedtest-cli
, run each line separately:
sudo apt-get install python-pip
sudo pip install speedtest-cli
- Download the
speedtest-csv
script. Note: A copy of this script is already stored in this repo, you can use this or re-download and make the changes to the file mentioned in step 5.
sudo wget -O speedtest-csv https://raw.githubusercontent.com/HenrikBengtsson/speedtest-cli-extras/master/bin/speedtest-csv
- Now give the file execute permissions:
sudo chmod +x speedtest-csv
- You will need to edit a line in the file to so that it can be run from CRON:
sudo nano speedtest-csv
Find the line cmd="speedtest-cli $opts
and add /usr/local/bin/
before it so it reads:
cmd="/usr/local/bin/speedtest-cli $opts"
save the file and exit.
- Next move
speedtest-csv
to/usr/bin/
:
sudo mv speedtest-csv /usr/bin/
- Generate the CSV header:
sudo speedtest-csv --header >> /cron/speedtest/speedtest.csv
- Add to the CRON:
sudo crontab -e
- Add the following line to the end of the file, this example is daily, ever four hours:
0 */4 * * * speedtest-csv >> /cron/speedtest/speedtest.csv
save the file and exit.