Help Needed (please) with a VERY simple script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • IAmATeaf
    DK Veteran
    • Mar 2011
    • 591

    #46
    If you've edited the script to just run ping BBC - Homepage and then run that script every minute then you will end up with mutiple pings running as the Unix variant of ping carries on until you interrupt it. So each ping will send 65 bytes of data and each minute a new execution of the script will be spawned.

    It's also sort of clear from your post that if you use ping -c 5 where it would only send 5 pings before exiting than that's not enough. What you need to try is sending larger data as per my post above or find out how many copies of ping you need running in order to keep the modem running as you want.

    Comment

    • davvo
      DK Veteran
      • Apr 2009
      • 666

      #47
      Originally posted by IAmATeaf
      If you've edited the script to just run ping BBC - Homepage and then run that script every minute then you will end up with mutiple pings running as the Unix variant of ping carries on until you interrupt it. So each ping will send 65 bytes of data and each minute a new execution of the script will be spawned.

      It's also sort of clear from your post that if you use ping -c 5 where it would only send 5 pings before exiting than that's not enough. What you need to try is sending larger data as per my post above or find out how many copies of ping you need running in order to keep the modem running as you want.

      you not read the last few post
      he has the picture stable
      but
      he is using to much data

      i dont think you can keep the modem in high speed
      with out using a fair bit of data

      when you boot check the log to see if it pings on boot

      overnight it has used 652mb
      have you got the every second script still on ?

      how many peers you have

      we just solve one problem and created another
      Last edited by davvo; 8 May, 2012, 22:18.

      Comment

      • tipster69
        Member
        • Dec 2008
        • 91

        #48
        Hi,

        I could do with a means of monitoring the data live so to speak, because currently I am only using the data remaining from my 1gb allowance via the THREE Website to tell me what is being used.

        I have been monitoring it tonight and I find the results very strange.

        216mb remaining @ 18:00
        208mb remaining @ 19:00
        208mb remaining @ 19:23
        208mb remaining @ 19:55
        208mb remaining @ 20:09
        208mb remaining @ 20:38
        186mb remaining @ 21:30
        186mb remaining @ 21:55

        I know for sure I cannot use it for its intended use abroad due to the already excessive cost per (?40 for 200mb).

        So I really need to try and get a handle on just WTF is happening to the data, .

        CHEERS FOR THE HELP

        P.S There couldn't be something else that is likely to be running in the background that is using the data? My first thought was the EPG, but I have the automatic update turned off.
        Last edited by tipster69; 8 May, 2012, 22:40.

        Comment

        • davvo
          DK Veteran
          • Apr 2009
          • 666

          #49
          what is in your script -c35 ?

          your using 7.5mb an hour

          Comment

          • tipster69
            Member
            • Dec 2008
            • 91

            #50
            Hi,

            There is only one line in the script, it is a ping without any parameters:

            ping bbc.co.uk

            There are absolutely no other lines in the script other than the above.

            The line that calls the script is the same as you initially taught me in the root file in /var/etc/bhcron

            */1 * * * * /usr/script/ping.check.sh

            Thanks again for your continued support with this.

            Comment

            • davvo
              DK Veteran
              • Apr 2009
              • 666

              #51
              i just tested that on mine
              you are continuously pinging 64 bytes of data
              so you need to limit that in the script
              try
              ping -c 20
              that will cut it by 2 thirds
              Last edited by davvo; 9 May, 2012, 09:57.

              Comment

              • tipster69
                Member
                • Dec 2008
                • 91

                #52
                Hi,

                I decided to start again and so installed everything from page one from the ping.rar

                Now I don't know where or what has gone wrong, but the checkconnection.log file is empty all the time.

                So I have gone to the file explorer in TSpanel, and executed the ping.check.sh script and it runs the Ping but then returns: Syntax Error - line 9 unexpected end of file - expected "then"
                Last edited by tipster69; 9 May, 2012, 13:53.

                Comment

                • davvo
                  DK Veteran
                  • Apr 2009
                  • 666

                  #53
                  the script on page 1 post 6 works fine

                  checkconnection.log also filling up

                  use ddc telnet to execute the ping with

                  /usr/script/ping.check.sh

                  just change ping -c 5 to ping -c 20


                  Code:
                  root@dm800:~# /usr/script/ping.check.sh                   
                  PING 173.194.67.94 (173.194.67.94): 56 data bytes         
                  64 bytes from 173.194.67.94: seq=0 ttl=45 time=29.044 ms  
                  64 bytes from 173.194.67.94: seq=1 ttl=45 time=28.812 ms  
                  64 bytes from 173.194.67.94: seq=2 ttl=45 time=29.084 ms  
                  64 bytes from 173.194.67.94: seq=3 ttl=45 time=29.314 ms  
                  64 bytes from 173.194.67.94: seq=4 ttl=45 time=28.686 ms  
                                                                            
                  --- 173.194.67.94 ping statistics ---                     
                  5 packets transmitted, 5 packets received, 0% packet loss 
                  round-trip min/avg/max = 28.686/28.988/29.314 ms
                  my pings are high cuz my son and his mates are online with ps3
                  Last edited by davvo; 9 May, 2012, 14:36.

                  Comment

                  • tipster69
                    Member
                    • Dec 2008
                    • 91

                    #54
                    Hi Davvo,

                    I am definitely going backwards here. It's just not working properly for me

                    The thing is, I have over the past weeks & months played with all the different -c options (from 5 thru to 60), and it never really worked properly.

                    The only thing that has worked properly is to just run a one line ping. It works almost perfectly.

                    I am convinced that is the way to go, and I think the problem is that not only am I running a constant ping. I am running numerous constant pings because of the cron file that initialises the ping (and I don't know how else to start running the ping when I won't have access to a telnet option in the Motorhome.)

                    If I want to run a constant ping (just one instance of it) even if it sends and receives 64 bytes every second, surely it wouldn't use the data I am using.

                    Can you confirm my maths here please because something doesn't just add up for me.

                    If it sends AND receives 64 bytes every second = 128 bytes per second.

                    128 bytes = 7680 bytes per minute

                    7680 bytes x 60 mins = 460,800 bytes per hour.

                    460,800 bytes x 24 hours = 11,059,200 bytes

                    1mb = 1,048,576 bytes

                    Which means over 24 hours I should use 10.54 mb

                    This would easily be workable and wouldn't bother my data usage at all.

                    This is really all I need to achieve, just one instance of ping running constantly (ping bbc.co.uk will do it).

                    If I could just run it via the remote control when required that would do me, I don't really need it to start automatically because for the most part I will be on my ethernet broadband connection.

                    CHEERS
                    Last edited by tipster69; 9 May, 2012, 15:49.

                    Comment

                    • davvo
                      DK Veteran
                      • Apr 2009
                      • 666

                      #55
                      what else is connected
                      where are you getting the line from

                      Comment

                      • davvo
                        DK Veteran
                        • Apr 2009
                        • 666

                        #56
                        Originally posted by tipster69

                        I think the problem is that not only am I running a constant ping. I am running numerous constant pings because of the cron file that initialises the ping
                        try the crontab at 2 minutes
                        then it will run for 1 min and stop for 1 min

                        */2 * * * * /usr/script/ping.check.sh

                        Comment

                        • tipster69
                          Member
                          • Dec 2008
                          • 91

                          #57
                          Hi Davvo,

                          Firstly, i have had it running for the past couple of hours using the -c option and it just doesn't keep it at high speed, as soon as there is the SLIGHTEST break in the ping, it stops. So it just wont work.

                          Before, when I was running nothing more than ping bbc.co.uk, it hardly ever dropped out of high speed mode.

                          With regards to your post above, I don't think it will run for 1 minute and stop for one minute as you suggest. I am sure that when a ping is run without the -c option that it just keeps running infinitely, and that is exactly what I need to happen. But if I run it with a 2 in the crontab, I think after one hour I will have 30 pings running simultaneously, infinitely. Which is why the data is so huge. (i.e 30x 64kb will be sent 60 times a minute - i.e lots of data).

                          I need nothing more than one single ping running. I need to start "ping bbc.co.uk", and that is it.

                          Is it possible to run a script with "ping bbc.co.uk", just once, either at bootup, or when I select it. Because the one instance will make it run, and run infinitely.

                          I could perhaps use a crontab of 1000 that will only start it every 1000 minutes, but this will only work if it sends the first one on boot up and then the others afterwards.

                          Your continued support with this is much appreciated mate.

                          CHEERS

                          *** EDIT: I have changed the crontab to 500 and it obviously doesn't start on boot up, as I have had it running for 15 mins and it definitely hasn't kicked in as the modem as been in slow mode the whole time rendering it totally unwatchable.
                          Last edited by tipster69; 9 May, 2012, 18:03.

                          Comment

                          • davvo
                            DK Veteran
                            • Apr 2009
                            • 666

                            #58
                            i wiil try and make it start at boot
                            leaving the crontab out

                            Comment

                            • tipster69
                              Member
                              • Dec 2008
                              • 91

                              #59
                              Hi Davvo,

                              As an aside, I have just got a Telnet client for the iPhone and I can connect to the DM800 via this. I have run the script via telnet (/usr/script/ping.check.sh) and I can see the infinite ping running on the iPhone screen.

                              My question is this, when I exit the telnet client on the iPhone, will the script still be running on the DM800 or will it stop?

                              EDIT: I think it would be better if I could run it from the DM800 direct, as the Ping appears to be stopping once I disconnect from the telnet client.
                              Last edited by tipster69; 9 May, 2012, 20:20.

                              Comment

                              • IAmATeaf
                                DK Veteran
                                • Mar 2011
                                • 591

                                #60
                                Run the command with an & at the end, that will run the command in the background.

                                Comment

                                Working...