[mythtv-users] mythfilldatabase runs from command line, but not from cron

Dave M G martin at autotelic.com
Mon Nov 12 03:46:07 UTC 2007


I have set up a script and a cron job to fetch TV schedule data and fill 
  the MythTV database once a day.

When I run the script myself from the command line, it works fine, which 
seems to indicate that the script works perfectly.

The script also includes a sendEmail command to let me know it's run, 
and I get that confirmation at the correct time each day. This would 
indicate that the cron job is executing properly.

So, both are working fine, and so together they should operate fine too.

But they don't. As days go by, I can see that the schedule is not 
receiving any new shows since last time I ran the script by hand.

This is the content of my script:
- - -
/usr/bin/tv_grab_jp --config-file /home/media/scripts/tv_grab.jp.conf 
--output /home/media/scripts/jtv.xml
/usr/bin/mythfilldatabase --file 1 -1 /home/media/scripts/jtv.xml
sendEmail(details omitted for security)
- - -

Here is my crontab entry:
0 11 * * * /home/media/scripts/getschedule.sh

Inside the mythfontend interface, under Information Center->System 
Status, there is a note that says:
Result: mythfilldatabase ran, but did not inser...

Unfortunately, the message cuts off, and I can't find any reference to 
it in any log file in /var/log/mythtv.

Speaking of logs, they are mostly empty, and as far as I can tell, don't 
contain any obvious mention of mythfilldatabase at all, let alone any 
indicative errors.

Very strange. Why would the script execute from the prompt, but not work 
when run from cron?

Thank you for any advice.

Dave M G

More information about the mythtv-users mailing list