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

Kris B. krisbee at krisbee.com
Thu May 10 11:41:57 UTC 2012


On Thu, May 10, 2012, at 02:47 PM, Igor Cicimov wrote:

On Thu, May 10, 2012 at 2:05 PM, Gabe Rubin
<[1]gaberubin at gmail.com> wrote:

On May 9, 2012, at 8:48 PM, "Michael T. Dean"
<[2]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 [3]optimize_mythdb.pl and
[4]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?

_______________________________________________
mythtv-users mailing list
[5]mythtv-users at mythtv.org
[6]http://www.mythtv.org/mailman/listinfo/mythtv-users

It's a shell thing. So have in mind that when you run the cronjob
it runs without shell so it doesn't inherit your environment
settings which explains why it is successful from the shell
command line and fails from cron.



You need to source your /home/mythtv/.mythtv/backuprc file first.
So try putting the cron like this:



30 3 * * * . /home/mythtv/.mythtv/backuprc
&& /usr/bin/[7]mythconverg_backup.pl

               ^

(yes, that's a dot then a space then the rest of the line here)



Igor





_______________________________________________

mythtv-users mailing list

[8]mythtv-users at mythtv.org

[9]http://www.mythtv.org/mailman/listinfo/mythtv-users


Mine wouldn't backup from cron if there is an error in the
database - like a channel improperly closed, etc.  If you go to
mythweb and do a database check, are they all OK?  If not, then
fix and then see what happens.

--
Kris B.
[10]krisbee at krisbee.com

References

1. mailto:gaberubin at gmail.com
2. mailto:mtdean at thirdcontact.com
3. http://optimize_mythdb.pl/
4. http://mythconverg_backup.pl/
5. mailto:mythtv-users at mythtv.org
6. http://www.mythtv.org/mailman/listinfo/mythtv-users
7. http://mythconverg_backup.pl/
8. mailto:mythtv-users at mythtv.org
9. http://www.mythtv.org/mailman/listinfo/mythtv-users
  10. mailto:krisbee at krisbee.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20120510/6448e6cc/attachment.html>


More information about the mythtv-users mailing list