[mythtvnz] cron.daily mythfilldatabase environment issue

Daniel Hughes trampster at gmail.com
Thu Sep 10 09:47:58 BST 2015


I have been trying to setup a daily cron job to udpate my listings
from http://epg.org.nz/freeview.xml.gz

My script runs fine if I run in manually but it fails when run from
cron with these errors:

2015-09-10 07:55:52.485142 W  This application expects to be running a
locale that specifies a UTF-8 codeset, and many features may behave
improperly with your current language settings. Please set the LC_ALL
or LC_CTYPE, and LANG variable(s) in the environment in which this
program is executed to include a UTF-8 codeset (such as
'en_US.UTF-8').
2015-09-10 07:55:52.485154 W  Cannot locate your home directory.
Please set the environment variable HOME
2015-09-10 07:55:52.485158 E  Failed to init MythContext, exiting.

Here is my script:
#! /bin/bash
echo "$(date) : starting epg import " >> /tmp/epggrubber.log
PATH=/usr/sbin:/usr/bin:/sbin:/bin
HOME=/home/mythtv
LANGUAGE=en_NZ:en
LANG=en_NZ.UTF-8
wget -O /tmp/freeview.xml.gz http://epg.org.nz/freeview.xml.gz >>
/tmp/epggrubber.log 2>&1
gunzip /tmp/freeview.xml.gz >> /tmp/epggrubber.log 2>&1
mythfilldatabase --update --file --sourceid 2 --xmlfile
/tmp/freeview.xml --update >> /tmp/epggrubber.log 2>&1
rm /tmp/freeview.xml
echo "$(date) : finished epg import " >> /tmp/epggrubber.log
exit

As you can see I am setting the environment variables for home and language.

Anyone know what I need to do to make it work?

Cheers,
Daniel Hughes



More information about the mythtvnz mailing list