Struggling with cron on dreamone

  • Tries to set up a cronjob on dreamone with the latest unstable image but does not make it work.

    Have there been any changes from OE2.5 to OE2.6?

    Thought this was enough:

    creates a new document in /etc/cron/crontabs/ which I call "root"

    And enters the string for the cron job.

    This does not work on dreamone, (must run the script manually in telnet, then it works)

    on my dm525 everything works with the same settings.


    Help is needed if anyone wants....

  • cron does not load the shell environment variable PATH - so add the following line at the beginning of the crontab file


    Code
    PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin


    or use the absolute path to the executable binary instead of only the name. eg.


    /bin/echo instead of echo

    Gruß Fred

    Die Dreambox ist tot, es lebe die Dreambox

  • Unfortunately does not work...

    The script is loaded in /usr/bin


    Is this correct:?

    Code
    PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
    30 5 * * * /usr/bin/m3u2bouquet.sh >> /tmp/cron.log 2>&1

    cron.log is created in /tmp/ but is empty.

  • Looks OK.


    Are you sure you are using correct location? For creating a cronjob you shoud run:


    Code
    crontab -e

    What's the output of

    Code
    crontab -l

    Put some debug output like "echo test" at the very beginning in your script. If /tmp/cron-log is empty: Do you expect any content in the file?


    Can can check cron activity via


    Code
    journalctl | grep cron

    Edited once, last by AlBundy00 ().

  • ...

    Is this correct:?

    Code
    PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
    30 5 * * * /usr/bin/m3u2bouquet.sh >> /tmp/cron.log 2>&1

    ...

    No it is not correct. This is the crontab (read: file containing the "cron commands"), not a shell script.

    Each and every cronjob runs in an "empty" environment due to security reasons.

    If you need a specific environment, you need to prepare the environment in your running process (e.g. by setting a path WITHIN your script).

    This is not specific for the Dreambox but for all "regular" Unix systems.

    So the first command of your script (m3u2bouquet.sh) should be the setting of the PATH variable and then an export of that variable, so that all started processes within this script use this variable content.

    Ymmv.

    DM900 SS, DM8000SSSS
    Kein Support per PN! Nutzt das Forum zum Fragen, dann haben auch andere etwas davon.

  • Thanks everyone for the input:)

    I changed the image to gemini4-unstable-OE26-image-one-20200524120932.tar

    There was cron plug and play just like on my dm525.

    Created a file in etc/cron/crontab named root and used this cron:

    Code
    30 5 * * * /usr/bin/m3u2bouquet.sh >> /tmp/cron.log 2>&1


    What the problem is with is unstable image from DP I do not know, but can test again next week. Have a better time then.

    Used to nano crontab -e on linuxpc but have never used crontab -e on enigma2, how to save cron job on enigma2 when using crontab -e ?

  • which edior has been used by default? vi or nano?

    vi

    save and exit with: wq!


    nano:

    save with [Strg]+[W] or [Ctrl]+[W]

    and exit with [Strg]+[X] or [Ctrl]+[X]


    to check out the default editor:


    Code
    root@dm900:~# echo $EDITOR
    vi
    root@dm900:~#


    it's possible to change the default editor for example cron in the /etc/profile file


    Code
    Editor="/usr/bin/nano"

    Gruß Fred

    Die Dreambox ist tot, es lebe die Dreambox