Jump to content


Photo

Help with cronjob


  • Please log in to reply
7 replies to this topic

#1 DoeEensGek

  • Senior Member
  • 287 posts

+48
Good

Posted 15 August 2014 - 12:14

Guys, i cant get a cronjob to work.

 

My test cronjob works perfect,

 

 

echo "Nightly Backup Successful: $(date)" >> /tmp/mybackup.log

I've got a shell script which would stream a channel with vlc. So i can open the url on my phone and watch. The script works when doubleclick and when launching in terminal.

The script doenst launch from cronjob.

 

I've googled and tried very different setups...

 

This is the shell script;

 

#!/bin/bash

vlc http://192.16.......}' :sout-keep

 

cronjob command:

 

sh /home/emiel/Bureaublad/test

 

Script named 'test', did try 'test.sh' but no difference.

Also did try:

sh /home/emiel/Bureaublad/test.sh
/home/emiel/Bureaublad/test
/home/emiel/Bureaublad/test.sh

But cant find the solution...



Re: Help with cronjob #2 mirakels

  • Forum Moderator
    PLi® Core member
  • 7,599 posts

+62
Good

Posted 15 August 2014 - 13:49

your script seems executable as it runs when you double click on it. So I guess this script is on your desktop linux machine?

And now you want to run it as a cronjob on your STB?


Geen wonder... Had slechts een dm7000, maar wel ook een rotor. eigenlijk al een tijdje ook een dm600 en dm7025. Maar nu kijkend met een et9000 en vuduo

Re: Help with cronjob #3 DoeEensGek

  • Senior Member
  • 287 posts

+48
Good

Posted 15 August 2014 - 14:37

your script seems executable as it runs when you double click on it. So I guess this script is on your desktop linux machine?

And now you want to run it as a cronjob on your STB?

Nope, I would run it on my desktop (ubuntu).



Re: Help with cronjob #4 DoeEensGek

  • Senior Member
  • 287 posts

+48
Good

Posted 15 August 2014 - 16:16

While checking, syslog shows;

Aug 15 17:09:01 **-P5QL-PRO CRON[6353]: (**) CMD (/mnt/20741EE6741EBE8A/test)

Still nothing did happen.



Re: Help with cronjob #5 mirakels

  • Forum Moderator
    PLi® Core member
  • 7,599 posts

+62
Good

Posted 15 August 2014 - 18:44

ok so this is a general linux question.

 

Then check your cronlog, probably somewhere in /var/log/cron

 

And change your crontab entry to capture all output, for example like:

 

 

      /usr/bin/ls  >> /tmp/mycronjob.log 2>&1

 

Another advise is to explicitly make sure the commands in your scripts can be found.

Just calling 'vlc' might not be enough. Make sure the path to vlc is added to the PATH environment variable or specify the full pathname to call vlc, e.g. /usr/local/bin/vlc


Geen wonder... Had slechts een dm7000, maar wel ook een rotor. eigenlijk al een tijdje ook een dm600 en dm7025. Maar nu kijkend met een et9000 en vuduo

Re: Help with cronjob #6 greatred

  • Senior Member
  • 268 posts

+2
Neutral

Posted 15 August 2014 - 20:47

...

#!/bin/bash

vlc http://192.16.......}' :sout-keep

...

 

Is that an empty line between shebang and command ?



Re: Help with cronjob #7 DoeEensGek

  • Senior Member
  • 287 posts

+48
Good

Posted 15 August 2014 - 21:46

...

#!/bin/bash

vlc http://192.16.......}' :sout-keep

...

 

Is that an empty line between shebang and command ?

Yes, thats an empty line.

 

Ok i found out the logs, and did what you wrote mirakels.

Found that cvlc woks, while vlc (the one with interface) doesnt work.

Dont know why.



Re: Help with cronjob #8 mirakels

  • Forum Moderator
    PLi® Core member
  • 7,599 posts

+62
Good

Posted 15 August 2014 - 23:42

oh, vlc probably needs a graphical interface to run on (e.g. needs a proper DISPLAY environment variable.) cvlc probably can do without...


Geen wonder... Had slechts een dm7000, maar wel ook een rotor. eigenlijk al een tijdje ook een dm600 en dm7025. Maar nu kijkend met een et9000 en vuduo


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users