running speedtest-cli automatically?

Israel israeldahl at gmail.com
Wed Dec 3 22:47:32 UTC 2014


On 12/03/2014 08:04 AM, Mark MacKenzie wrote:
> Good morning.
>
> I live in an area (northern New Mexico) where the internet service is
> decent during the day but falls off miserably during the evening when
> of course everyone around me is using it.
>
> However, the local provider (Windstream) insists on testing the
> download speeds only during the day when I complain so of course the
> download speed makes spec, during that time.  During the day it is
> usually about 7 mbsec.  That is only during the normal work week.
>
> So, I downloaded and installed speedtest-cli.  It runs well from the
> command line.  I would like to have it run every 10 or 15 minutes and
> record the speed test in a file so that I can graph it.  I would also
> need the system time.
>
> I am not literate enough in command line syntax or structure to
> program this.
>
> Does anyone know how to do this with speedtest-cli or can suggest
> another program which can?
>
> Oh, yes, I am running the current Lubuntu distro on an older Pentium
> IV sony Vaio.
>
> Thank you
>
> Matadormac
> Alcalde, NM
>
Hi,
I do not know about speedtest... but
here is an infiniteloop script
save this as a file and make it executable
chmod +x whateveryounamedthis.sh

run it...

#!/bin/bash
while :
do
  speedtest-cli
  sleep 10m
done

I suggest opening a terminal window and running it, that way you can Ctrl+C
or close the terminal to kill the process.
If you want to log the output that will require more scripting... unless
speedtest does this for you.
And mind you I do not know how speedtest works, so you will have to run
it however you normally run it, and exit it however you normally exit it...
Which could mean you need to kill the process each time as well...
anyhow this should get you going in the right direction...  you can
always read the manual about speedtest
man speedtest-cli

-- 
Regards




More information about the Lubuntu-users mailing list