[mythtv-users] Mythtv automatic database backup

Bill Meek keemllib at gmail.com
Sun Nov 24 19:47:01 UTC 2019


On 11/24/19 12:47 PM, Don Brett wrote:
> On 11/24/2019 10:08 AM, Mike Bibbings wrote:
>> On 24/11/2019 14:30, Don Brett wrote:
>>> Does Mythtv do automatic database backups, or do I need to setup my own cron job?  Years ago, I thought it did it by itself.
>>>
>>> Don
>>>
>> The packaged versions of mythtv e.g. on Ubuntu should automatically do a backup weekly, keeping the last 5 backups.
>>
>> Note there is a bug in mythtv 30 in that the backup fails.
>>
>> This has been fixed in mythtv master (31pre).
>>
>> If you want a weekly backup, replace the contents of file /etc/cron.weekly/mythtv-database
>>
>> with the contents from https://github.com/MythTV/packaging/blob/master/deb/debian/mythtv-database.cron.weekly
>>
>> Personally, I put the corrected mythtv-database file in /etc/cron.daily/ for a daily backup.
>>
>>
>> Mike


> I added the updated script to /etc/cron.daily.  It runs manually, but not sure how to get cron to run it on demand for a test.  I'm happy to 
> wait until tomorrow to see the results.  By the way, it doesn't look like the script does the rotate feature, it that done somewhere else, or do 
> I need to add something?
> 
>   Don

If you look in /etc/crontab, it's likely that anacron is really going to
run the jobs in /etc/cron.*/*. sudo anacron -dfn will run them now and
report on the command line.

The number of files kept is defined by the --rotate switch on the command line or
in the .mythtv/backuprc file of the user running the script (it does honor $MYTHCONFDIR.)
See:

   /usr/local/share/mythtv/mythconverg_backup.pl --help --help | less

The default number is 5. -1 Turns rotate off.

-- 
Bill


More information about the mythtv-users mailing list