[mythtv-users] Why is my cron job not backing up my database?

Anthony Messina amessina at messinet.com
Thu May 10 07:16:27 UTC 2012


On 05/10/2012 01:35 AM, Robin Gilks wrote:
>> >
>> >
>> > On May 9, 2012, at 8:48 PM, "Michael T. Dean" <mtdean at thirdcontact.com>
>> > wrote:
>> >
>>> >> On 05/09/2012 11:43 PM, Bill Meek wrote:
>>>> >>> On 05/09/2012 10:33 PM, Gabe Rubin wrote:
>>>> >>> ...
>>>>> >>>> [mythtv at localhost backup]$ more /home/mythtv/.mythtv/backuprc
>>>>> >>>> DBBackupDirectory=/home/mythtv/.mythtv/backup
>>>>> >>>>
>>>>> >>>> And the command works from the command line.  It just seems that none
>>>>> >>>> of my cronjobs are functioning.
>>>> >>>
>>>> >>> But isn't your cron job running as root? If so, there
>>>> >>> should be a similar entry in ~root/.mythtv.
>>>> >>>
>>>> >>> At least that would explain why cron fails and command line works.
>>>> >>>
>>> >>
>> >
>> > This is my mythtv cron job.  What I pasted in my first email was from
>> > running crontab -e as the mythtv user.
>> >
>>> >> And/or you need to specify a value for HOME to point to /home/mythtv
>>> >>
>>> >> (without a valid HOME, nearly all things MythTV will fail--including
>>> >> optimize_mythdb.pl and mythconverg_backup.pl)
>>> >>
>> >
>> > I am not sure I understand what this means. And does it change anything
>> > that the cron job is running as mythtv?
> Are your log files getting rotated? If so it may be that just the perl
> scripts are failing. Check to see if perl is running in 'safe' mode. This
> will bail out if the root user tries to run them. Test by logging in as
> root (not just sudo) and run from the command line. The relevant lines may
> have to be adjusted to run as the mythtv user:
> su mythtv -c command.pl

I apologize for missing your first post so I'm not sure if you're
running 0.25, but, I found that my cron jobs were failing as well with a
'working' mysql.txt.

However, this support was removed from the perl bindings:
http://code.mythtv.org/trac/ticket/10305 in master.

After I populated the ~/.mythtv/config.xml, optimize_mythtb.pl worked
properly.

Maybe this is something else to check.

-- 
Anthony - http://messinet.com - http://messinet.com/~amessina/gallery
8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20120510/c4c605c5/attachment.sig>


More information about the mythtv-users mailing list