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

Chris Isip cmisipster at gmail.com
Mon Nov 12 04:22:17 UTC 2007


On Nov 11, 2007 10:46 PM, Dave M G <martin at autotelic.com> wrote:

> MythTV,
>
> 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:
> - - -
> #!/bin/bash
> /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
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>


Are you running the cron job as root?  Perhaps you should try to run it as
the user that owned the command line.

You shouldm't have to do this though, as Myth handles running the
mythfilldatabase automatically.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20071111/afbd6db9/attachment.htm 


More information about the mythtv-users mailing list