<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Nov 24, 2019 at 10:31 AM Bill Meek <<a href="mailto:keemllib@gmail.com">keemllib@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 11/24/19 8:39 AM, Doug Lytle wrote:<br>
> On 11/24/19 9:30 AM, Don Brett wrote:<br>
>> 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.<br>
> <br>
> <br>
> cron job, mine is below; I compile from source, so paths will likely be different:<br>
> <br>
> 45 18 * * * /usr/local/share/mythtv/<a href="http://mythconverg_backup.pl" rel="noreferrer" target="_blank">mythconverg_backup.pl</a> --rotate 10 --compress gzip<br>
> <br>
> <br>
> Doug<br>
<br>
The only automatic ones are done when the DB is upgraded. Unless "Disable automatic database backup"<br>
is set.<br>
<br>
There's also a Services API endpoint. If, for some reason, you wanted to start the backup from<br>
an app or different host/state/country/... It uses the settings in ~mythtv/.mythtv/backuprc.<br>
<br>
e.g. curl --header 'Accept:application/JSON' --request POST yourBackend:6544/Myth/BackupDatabase<br>
<br>
Returns: {"bool": "true"} if successful. It uses <a href="http://mythconverg_backup.pl" rel="noreferrer" target="_blank">mythconverg_backup.pl</a> if it can be found.<br>
<br>
-- <br>
Bill<br>
_______________________________________________<br><br></blockquote><div>I got a suggestion many years ago from to do daily database backups and also optimized the database. I think it was from Stephen Worthington (JSW). I used his scripts modifying filenames and adding  a send mail message so I'd know if it was working without having to login to check. It's setup a 2 separate script.</div><div>jim@mythbuntu:/etc/cron.daily$ cat mythtv-backup <br>#!/bin/sh<br># /etc/cron.weekly/mythtv-database script - check and backup mythconverg tables<br># Copyright 2005/12/02 2006/10/08 Paul Andreassen<br>#                      2010 Mario Limonciello<br><br># JSW Modified for /etc/cron.daily backups to a network drive.<br><br>set -e -u<br><br>DBNAME="mythconverg"<br>DEBIAN="--defaults-extra-file=/etc/mysql/debian.cnf"<br><br># Debug:<br>/usr/bin/logger -p <a href="http://daemon.info">daemon.info</a> -i -t${0##*/} "Debug: $DBNAME cron.daily checking started."<br><br>/usr/bin/mysqlcheck $DEBIAN -s $DBNAME<br><br># Debug:<br>/usr/bin/logger -p <a href="http://daemon.info">daemon.info</a> -i -t${0##*/} "Debug: $DBNAME cron.daily checking finished, backup starting."<br><br>/usr/bin/nice -n 2 /usr/share/mythtv/<a href="http://mythconverg_backup_jsw.pl">mythconverg_backup_jsw.pl</a> --directory "/mnt/md1/samba/public/Backups/MythTV_db_backup/" --tempdir "/mnt/md1/tmp"<br><br>/usr/bin/logger -p <a href="http://daemon.info">daemon.info</a> -i -t${0##*/} "$DBNAME checked and backed up."<br><br>now="$(date)"<br>echo "$DBNAME checked and backed up on $now" | mail -s "$DBNAME checked and backed up" <a href="mailto:jfabernathy@gmail.com">jfabernathy@gmail.com</a><br><br># End of file.<br></div><div>-------------------</div><div>jim@mythbuntu:/etc/cron.daily$ cat optimize_mythdb <br>#!/bin/sh<br><br>OPT_MYTHDB='/usr/share/doc/mythtv-backend/contrib/maintenance/<a href="http://optimize_mythdb.pl">optimize_mythdb.pl</a>' <br>LOG='/var/log/mythtv/optimize_mythdb.log'<br><br># Debug:<br>/usr/bin/logger -p <a href="http://daemon.info">daemon.info</a> -i -t${0##*/} "Debug: cron.daily optimize_mythdb started."<br><br>echo "Started ${OPT_MYTHDB} on `date`" >> ${LOG}<br>${OPT_MYTHDB} >> ${LOG}<br>echo "Finished ${OPT_MYTHDB} on `date`" >> ${LOG}<br><br># Debug:<br>/usr/bin/logger -p <a href="http://daemon.info">daemon.info</a> -i -t${0##*/} "Debug: cron.daily optimize_mythdb ended."<br>now="$(date)"<br>echo "cron.daily optimize_mythdb has been run on $now" | mail -s "optimized_mythdb" <a href="mailto:jfabernathy@gmail.com">jfabernathy@gmail.com</a><br></div><div><br></div><div>It's still works great on ubuntu 18.04 and mythtv v30</div><div><br></div><div>Jim A</div></div></div>