Hello Guest, if you are reading this it means you have not registered yet. Please take a second, Click here to register, and in a few simple steps you will be able to enjoy our community and use our OpenViX support section.
Page 1 of 4 123 ... LastLast
Results 1 to 15 of 48

Thread: Help needed please with cron timer

  1. #1
    grantdavey91's Avatar
    Title
    Forum Supporter
    Donated Member
    Join Date
    Feb 2015
    Location
    Essex UK
    Posts
    313
    Thanks
    115
    Thanked 290 Times in 111 Posts

    Help needed please with cron timer

    Hi, All, hoping somebody can help me here

    I have been trying this all day!

    I and a few friends have created a home page screen which puts it in the place of the bouquet selector (show bouquet on launch) so instead of getting a list of all the bouquets, we get this :

    1_0_1_1656_7E5_2_11A0000_0_0_0.jpg

    Now, although this looks similar to official sly's homepage for their box, we're not in any way trying to clone the official sly completely, just experimenting with the possibilities of e2 and see how far we can push the GUI and still have it running as it should - it's just a project (note : the images on the screen are visual only - you can't go into them - only function is 'ok' and this takes you to the graphical EPG)

    creating this mod hasn't been a problem, and as far as testing it out, it works flawlessly

    We decided after creating this mod to try and create a shell script to work with a cron timer on the box to pull images automatically from the web

    Well it works, but there are a few issues, mainly only for me grr! i've tried so many things and hoping someone can help me here

    At first, the shell script didn't work ; so we used a python file instead to pull a set of images from github and work with the cron timer ; when the cron timer runs, it automatically downloads the images and overwrites existing ones on the box; and it works - to get it to work a python script was created and placed in the filesystem, then it was just a case of creating a cron timer to point to that location e.g. /usr/bin/python /usr/script/toppicks.py

    the only problem we are finding with this is that it's not a fully automated solution - in order to change the images and keep them updating to other images, they need to be changed on github by one of us - making it automatic for those using it, but not for the person who has to manually update the images every so often

    Today there was a bit of a breakthrough though, it was re-visited and a shell script was created to pull images from an online source which is automatically and regularly updated/changed

    to get this to work, the new shell script was placed in the filesystem , then a new cron timer was added to enable the automatic downloads and updates of the screen

    Now the problem I have, it's not working for me, although a few of the guys who helped make this possible it is working for them, and i have done exactly the same as them

    everything is in the right place, but when i telnet into the box and run the command /usr/script/toppicks2.sh - i get the error "not found" , so instead i tried the command cd /usr/script and then tried ./toppicks2.sh - still "not found" , I then tried /bin/sh /usr/script and i got :

    : not found.sh: line 4:
    Connecting to www.*****.com (104.65.19.97:80)
    htmlpage 100% |*******************************| 105k 0:00:00 ETA
    : not found.sh: line 7:
    cat: can't open 'htmlpage': No such file or directory
    : not found.sh: line 10:
    : not found.sh: line 12:
    sed: links.txt: No such file or directory
    ?w=400&h=240&mode=stretch&format=png
    'get: bad address '
    : not found.sh: line 20:
    sed: links.txt: No such file or directory
    'get: bad address '
    : not found.sh: line 27:
    sed: links.txt: No such file or directory
    'get: bad address '
    : not found.sh: line 34:
    sed: links.txt: No such file or directory
    'get: bad address '
    : not found.sh: line 41:
    sed: links.txt: No such file or directory
    'get: bad address '

    now we know this works, because most others who know what they're doing and have tried it, it's a success, it downloads the images, overwrites the current ones and displays them

    I don't know what else to try , I have definitely chmod the files for execution and the path to the relevant files is definitely right, cron jobs are correct currently set up to run daily however by putting the command in telnet that should run it there and then.

    Does anybody have any advice? What could I be doing wrong

    Is it possible my root filesystem needs to be updated or is there a github source where i could re-install busybox-cron if needed or the sh located in /bin

    Thanks in advance for any help, much appreciated
    - Vu+ Duo 2 1 x DVB-S/S2 Twin Tuner, 1 x DVB-C/T/2 Twin Hybrid Tuner, 1TB Internal HDD; Vu+ Official Qwerty remote, w/ OpenVix 4.2 & Slyk1HD V5.1 Skin by kiddac
    - Technomate 97cm Mesh Satellite Dish with Octo 8 way LNB
    - Android 5.0.1 Lollipop Smart TV Box w/ Kodi v16.1 Jarvis custom flashed for EXMP fully loaded


    FULL Picon Sets for LCD Screens and GUI - SNP includes 28.2e Satellite, Virmin Cable, 13, 23 & 19 Sat & IPTV {click here}


  2. The Following User Says Thank You to grantdavey91 For This Useful Post:

    Bangord30 (15-09-16)

  3. #2
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,829
    Thanks
    239
    Thanked 1,664 Times in 1,311 Posts
    Quote Originally Posted by grantdavey91 View Post
    Hi, All, hoping somebody can help me here
    ...
    Does anybody have any advice? What could I be doing wrong
    The problem is in the script, not in cron, since it doesn't work from the command line
    So post the script here....anything else would just be wild guessing.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  4. #3
    grantdavey91's Avatar
    Title
    Forum Supporter
    Donated Member
    Join Date
    Feb 2015
    Location
    Essex UK
    Posts
    313
    Thanks
    115
    Thanked 290 Times in 111 Posts
    I can post the script but I know the script is working because everybody else who has tried it has worked for them it just doesn't seem to work on my duo2 and I have set it up exactly as they have
    - Vu+ Duo 2 1 x DVB-S/S2 Twin Tuner, 1 x DVB-C/T/2 Twin Hybrid Tuner, 1TB Internal HDD; Vu+ Official Qwerty remote, w/ OpenVix 4.2 & Slyk1HD V5.1 Skin by kiddac
    - Technomate 97cm Mesh Satellite Dish with Octo 8 way LNB
    - Android 5.0.1 Lollipop Smart TV Box w/ Kodi v16.1 Jarvis custom flashed for EXMP fully loaded


    FULL Picon Sets for LCD Screens and GUI - SNP includes 28.2e Satellite, Virmin Cable, 13, 23 & 19 Sat & IPTV {click here}


  5. #4
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,829
    Thanks
    239
    Thanked 1,664 Times in 1,311 Posts
    Quote Originally Posted by grantdavey91 View Post
    I can post the script but I know the script is working because ... it just doesn't seem to work on my duo2...
    So it's clearly not working.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  6. #5
    ccs's Avatar
    Title
    ViX Beta Tester
    Join Date
    Sep 2014
    Posts
    5,836
    Thanks
    554
    Thanked 1,277 Times in 1,089 Posts
    It sounds like the PATH variable isn't set up the same for everyone.

    The safest way to make it work is to use full path names in the script, then it should work anywhere, including when called from cron jobs.

  7. #6
    grantdavey91's Avatar
    Title
    Forum Supporter
    Donated Member
    Join Date
    Feb 2015
    Location
    Essex UK
    Posts
    313
    Thanks
    115
    Thanked 290 Times in 111 Posts
    Quote Originally Posted by birdman View Post
    So it's clearly not working.
    what i am trying to say is that there must some some sort of issue with my duo2, but i am not sure what - i have installed busybox correctly i even unistalled it by using the opkg remove command via telnet and reinstalled and it still didn't work

    i am trying to explain that the script isn't the issue because i know a fair few others that have it set up exactly how i have it set up, however for me it's not working - so i was posting here for assistance to establish where the problem could be on my box

    i appreciate the responses, although i'm asking for help not sarcasm - i understand how cron / busybox works and i am trying to say it is set up exactly as other users who have this mod running and it's working for them

    thanks
    - Vu+ Duo 2 1 x DVB-S/S2 Twin Tuner, 1 x DVB-C/T/2 Twin Hybrid Tuner, 1TB Internal HDD; Vu+ Official Qwerty remote, w/ OpenVix 4.2 & Slyk1HD V5.1 Skin by kiddac
    - Technomate 97cm Mesh Satellite Dish with Octo 8 way LNB
    - Android 5.0.1 Lollipop Smart TV Box w/ Kodi v16.1 Jarvis custom flashed for EXMP fully loaded


    FULL Picon Sets for LCD Screens and GUI - SNP includes 28.2e Satellite, Virmin Cable, 13, 23 & 19 Sat & IPTV {click here}


  8. #7
    grantdavey91's Avatar
    Title
    Forum Supporter
    Donated Member
    Join Date
    Feb 2015
    Location
    Essex UK
    Posts
    313
    Thanks
    115
    Thanked 290 Times in 111 Posts
    Quote Originally Posted by ccs View Post
    It sounds like the PATH variable isn't set up the same for everyone.

    The safest way to make it work is to use full path names in the script, then it should work anywhere, including when called from cron jobs.
    thanks for your reply, but i have already tried this - i have tried the full path e.g. usr/script/script.sh and i have tried /bin/sh /usr/script/script.sh and /bin/bash /user/script/script.sh

    it has chmod 777 for execution , when i type /usr/script/script.sh i get 'not found'

    if i put cd /usr/script ./script.sh i get 'not found'

    if i put /bin/sh /usr/script/script.sh i get the code as on post one and the same for /bin/bash /usr/script/script.sh

    it knows the file is there because i can change the chmod through telnet

    and i also have running another cron timer which works fine , as well as a python script ran through cron timers which again is also fine

    thanks
    - Vu+ Duo 2 1 x DVB-S/S2 Twin Tuner, 1 x DVB-C/T/2 Twin Hybrid Tuner, 1TB Internal HDD; Vu+ Official Qwerty remote, w/ OpenVix 4.2 & Slyk1HD V5.1 Skin by kiddac
    - Technomate 97cm Mesh Satellite Dish with Octo 8 way LNB
    - Android 5.0.1 Lollipop Smart TV Box w/ Kodi v16.1 Jarvis custom flashed for EXMP fully loaded


    FULL Picon Sets for LCD Screens and GUI - SNP includes 28.2e Satellite, Virmin Cable, 13, 23 & 19 Sat & IPTV {click here}


  9. #8
    ccs's Avatar
    Title
    ViX Beta Tester
    Join Date
    Sep 2014
    Posts
    5,836
    Thanks
    554
    Thanked 1,277 Times in 1,089 Posts
    ... I was referring to full path names within the script itself.

    From within telnet,

    "which command" tells you where it finds "command" eg which sh

    "env" lists all your environment variables.
    Last edited by ccs; 15-09-16 at 16:12.

  10. #9
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,829
    Thanks
    239
    Thanked 1,664 Times in 1,311 Posts
    Quote Originally Posted by grantdavey91 View Post
    i am trying to explain that the script isn't the issue ....
    And I'm trying to explain that without seeing the script I won't have any idea at all what to suggest.
    The error message seem to suggest a garbled script (did you leave/put DOS <CR> EOLs on it?), but beyond that I'll have no idea I see it.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  11. #10
    grantdavey91's Avatar
    Title
    Forum Supporter
    Donated Member
    Join Date
    Feb 2015
    Location
    Essex UK
    Posts
    313
    Thanks
    115
    Thanked 290 Times in 111 Posts
    Quote Originally Posted by ccs View Post
    ... I was referring to full path names within the script itself.

    From within telnet,

    "which command" tells you where it finds "command" eg which sh

    "env" lists all your environment variables.
    sorry i misunderstood ,

    this is what i get when type those commands

    Code:
    root@vuduo2:~# which command
    root@vuduo2:~# which sh
    /bin/sh
    root@vuduo2:~# which env
    /usr/bin/env
    root@vuduo2:~# env
    MAIL=/var/spool/mail/root
    USER=root
    SHLVL=1
    OLDPWD=/home/root
    HOME=/home/root
    HUSHLOGIN=FALSE
    LC_CTYPE=C.UTF8
    PS1=\u@\h:\w\$ 
    LOGNAME=root
    TERM=linux
    PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
    SHELL=/bin/sh
    PWD=/home/root
    EDITOR=/bin/editor
    root@vuduo2:~#
    - Vu+ Duo 2 1 x DVB-S/S2 Twin Tuner, 1 x DVB-C/T/2 Twin Hybrid Tuner, 1TB Internal HDD; Vu+ Official Qwerty remote, w/ OpenVix 4.2 & Slyk1HD V5.1 Skin by kiddac
    - Technomate 97cm Mesh Satellite Dish with Octo 8 way LNB
    - Android 5.0.1 Lollipop Smart TV Box w/ Kodi v16.1 Jarvis custom flashed for EXMP fully loaded


    FULL Picon Sets for LCD Screens and GUI - SNP includes 28.2e Satellite, Virmin Cable, 13, 23 & 19 Sat & IPTV {click here}


  12. #11
    grantdavey91's Avatar
    Title
    Forum Supporter
    Donated Member
    Join Date
    Feb 2015
    Location
    Essex UK
    Posts
    313
    Thanks
    115
    Thanked 290 Times in 111 Posts
    Quote Originally Posted by birdman View Post
    And I'm trying to explain that without seeing the script I won't have any idea at all what to suggest.
    The error message seem to suggest a garbled script (did you leave/put DOS <CR> EOLs on it?), but beyond that I'll have no idea I see it.
    ok no problem, script uploaded to this post

    i didn't create the script, a buddy of mine did - wherever the error may be it must be down to my particular box and if it runs differently to another - i know zgemma boxes aren't supported here, but he has the zgemma and works absolutely fine with the same exact setup

    i was trying to look at the possibility of looking into learning and re-writing into a python script instead because those seem to work with cron on my box but my brain cannot cope with that haha
    Attached Files Attached Files
    - Vu+ Duo 2 1 x DVB-S/S2 Twin Tuner, 1 x DVB-C/T/2 Twin Hybrid Tuner, 1TB Internal HDD; Vu+ Official Qwerty remote, w/ OpenVix 4.2 & Slyk1HD V5.1 Skin by kiddac
    - Technomate 97cm Mesh Satellite Dish with Octo 8 way LNB
    - Android 5.0.1 Lollipop Smart TV Box w/ Kodi v16.1 Jarvis custom flashed for EXMP fully loaded


    FULL Picon Sets for LCD Screens and GUI - SNP includes 28.2e Satellite, Virmin Cable, 13, 23 & 19 Sat & IPTV {click here}


  13. #12
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,829
    Thanks
    239
    Thanked 1,664 Times in 1,311 Posts
    Quote Originally Posted by grantdavey91 View Post
    ok no problem, script uploaded to this post
    The first three commands of the script are:
    Code:
    rm htmlpage
    rm htmlpage2
    rm htmlpage3
    but:
    1. The script doesn't first cd to the directory it needs to be running in, so it will run these in the HOME director of the account that is set to run it in cron.
    2. If these files do not exist you will get "Not found" error messages.

    So:
    add a cd to the working directory at the start, then use:
    Code:
    rm -f htmlpage htmlpage2 htmlpage3
    to avoid the errors.

    The 3 wget commands have the URL before the options. Whereas this works there are many Linux commands where the options have to come first, so using the same ordering here would be preferable (to get you into good habits).

    grep can take a list of files at the end of its options, so you don't need to cat into it (it's a "Useless use of cat").

    sort has a -u option, so "sort | uniq" can be replaced with just "sort -u".

    The comments say that the greps will be to links3.txt and links2.txt, but the latter is mis-typed as link2s.txt in the actual code.

    In the grep search strings, "(http|https)" can be replaced with "https?". (You then wouldn't need the -E option).

    You don't need to hard-wire 50 as the random number range (problem if you end up with <50 lines...). Just use "wc -l" to find out how many are actually there.

    The location of the skyicons should be parametrized, to makes it simpler to change. Easier to see that they are all the same, and easier to change when testing. You should also check that the directory exists.

    The downloads should be in two loops, given that there are only two different commands used.

    You need to delete all.txt before running the script a second time - otherwise you'll end up catting it onto itself. (My Linux Mint systems checks this and complains, which is how I spotted it). You might as well delete all the *.txt files you're about to recreate.

    But the actual code in the script should run OK. However, it doesn't correspond exactly to the one you had errors with in post1, as that mentions "links.txt", while this script does not. That also mentioned "get" - which makes me wonder if you'd edited it as a text file on an Apple system, then transferred that over. Apple text files are not Linux text files (unless something has changed in the last few years).

    Here's a version edited to include these points. You'll need to edit line 4 to set the working directory for your system.

    toppicks2.sh.zip
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  14. The Following User Says Thank You to birdman For This Useful Post:

    Bangord30 (16-09-16)

  15. #13
    grantdavey91's Avatar
    Title
    Forum Supporter
    Donated Member
    Join Date
    Feb 2015
    Location
    Essex UK
    Posts
    313
    Thanks
    115
    Thanked 290 Times in 111 Posts
    Birdman , thank you so much for taking the time to help with this, very much appreciated

    i have downloaded the edited version you provided (thank you) and i changed the directory, however when i run the command now, i get this message:

    Code:
    ./toppicks2.sh: line 51: syntax error: unexpected word (expecting "do")
    i looked at the file, and "do" is there

    Code:
    toppicks6.png gmanpanthro.png; do
    any thoughts?

    thanks once again
    - Vu+ Duo 2 1 x DVB-S/S2 Twin Tuner, 1 x DVB-C/T/2 Twin Hybrid Tuner, 1TB Internal HDD; Vu+ Official Qwerty remote, w/ OpenVix 4.2 & Slyk1HD V5.1 Skin by kiddac
    - Technomate 97cm Mesh Satellite Dish with Octo 8 way LNB
    - Android 5.0.1 Lollipop Smart TV Box w/ Kodi v16.1 Jarvis custom flashed for EXMP fully loaded


    FULL Picon Sets for LCD Screens and GUI - SNP includes 28.2e Satellite, Virmin Cable, 13, 23 & 19 Sat & IPTV {click here}


  16. The Following User Says Thank You to grantdavey91 For This Useful Post:

    Bangord30 (16-09-16)

  17. #14
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,829
    Thanks
    239
    Thanked 1,664 Times in 1,311 Posts
    Quote Originally Posted by grantdavey91 View Post
    i have downloaded the edited version you provided (thank you) and i changed the directory, however when i run the command now, i get this message:

    Code:
    ./toppicks2.sh: line 51: syntax error: unexpected word (expecting "do")
    i looked at the file, and "do" is there
    There's an issue with your editor.
    The preceding line ends with a "\" (meaning "continue on next line"), and must not have any trailing whitespace.
    You could remove the "\" and put line 51 at the end of line 50 - it's the way it is as I (still) use 80-column wide terminal windows, so tend to write my code accordingly.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  18. #15
    grantdavey91's Avatar
    Title
    Forum Supporter
    Donated Member
    Join Date
    Feb 2015
    Location
    Essex UK
    Posts
    313
    Thanks
    115
    Thanked 290 Times in 111 Posts
    Quote Originally Posted by birdman View Post
    There's an issue with your editor.
    The preceding line ends with a "\" (meaning "continue on next line"), and must not have any trailing whitespace.
    You could remove the "\" and put line 51 at the end of line 50 - it's the way it is as I (still) use 80-column wide terminal windows, so tend to write my code accordingly.
    thanks for the reply birdman

    i took out the \ but then i got the same error for line 50 :

    Code:
    ./toppicks2.sh: line 50: syntax error: unexpected word (expecting "do")
    i changed only the line 50/51, originally in your edited .sh, it was set like this :

    Code:
    for name in toppicks1.png toppicks3.png toppicks4.png \
      toppicks6.png gmanpanthro.png; do
    and i changed it to this :

    Code:
    for name in toppicks1.png toppicks3.png toppicks4.png toppicks6.png gmanpanthro.png; do
    i am using a mac, and the program i am using is text wrangler ; if that helps

    thanks
    - Vu+ Duo 2 1 x DVB-S/S2 Twin Tuner, 1 x DVB-C/T/2 Twin Hybrid Tuner, 1TB Internal HDD; Vu+ Official Qwerty remote, w/ OpenVix 4.2 & Slyk1HD V5.1 Skin by kiddac
    - Technomate 97cm Mesh Satellite Dish with Octo 8 way LNB
    - Android 5.0.1 Lollipop Smart TV Box w/ Kodi v16.1 Jarvis custom flashed for EXMP fully loaded


    FULL Picon Sets for LCD Screens and GUI - SNP includes 28.2e Satellite, Virmin Cable, 13, 23 & 19 Sat & IPTV {click here}


Page 1 of 4 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.