[mythtv-users] 5 Db rotate

Hika van den Hoven hikavdh at gmail.com
Sat Nov 22 15:37:42 UTC 2014


Hoi Daryl,

Saturday, November 22, 2014, 4:18:04 PM, you wrote:


> On Nov 22, 2014 10:08 AM, "Stephen Worthington" <stephen_agent at jsw.gen.nz> wrote:
>>
>> On Sat, 22 Nov 2014 09:23:31 -0500, you wrote:
>>
>> >Greetings Mythizens, I remember in previous setups having the 5 latest Db
>> >backups kept in /var/lib/mythtv/db_backups. That's not happening now, I am
>> >getting mythbuntu backups as a result of MCC, but they don't rotate, I go
>> >in and cull once in a while. From looking at the wiki I have the backup and
>> >restore scripts in /usr/share/mythtv, and I echo'd the location I want the
>> >backups to land in, my question is how do I set the frequency to daily and
>> >select the time? IIRC this used to happen without a cron job.
>> >Sort of related the box doesn't wakeup for Db backups or MFDB's is this
>> >even possible?     TIA Daryl
>>
>> In Mythbuntu, the backups are normally done weekly by a cron job that
>> is installed by one of the Mythbuntu packages:
>>
>>   /etc/cron.weekly/mythtv-database
>>
>> That file contains this in 14.04:
>>
>> #!/bin/sh
>> # /etc/cron.weekly/mythtv-database script - check and backup
>> mythconverg tables
>> # Copyright 2005/12/02 2006/10/08 Paul Andreassen
>> #                      2010 Mario Limonciello
>>
>> set -e -u
>>
>> DBNAME="mythconverg"
>> DEBIAN="--defaults-extra-file=/etc/mysql/debian.cnf"
>>
>> /usr/bin/mysqlcheck $DEBIAN -s $DBNAME
>>
>> /usr/share/mythtv/mythconverg_backup.pl
>>
>> /usr/bin/logger -p daemon.info-i -t${0##*/} "$DBNAME checked and
>> backedup."
>>
>> # End of file.
>>
>>
>> I have put a modified copy of that file in /etc/cron.daily to also do
>> daily backups to another PC on my network:
>>
>> #!/bin/sh
>> # /etc/cron.weekly/mythtv-database script - check and backup
>> mythconverg tables
>> # Copyright 2005/12/02 2006/10/08 Paul Andreassen
>> #                      2010 Mario Limonciello
>>
>> # JSW Modified for /etc/cron.daily backups to a network drive.
>>
>> set -e -u
>>
>> DBNAME="mythconverg"
>> DEBIAN="--defaults-extra-file=/etc/mysql/debian.cnf"
>>
>> # Debug:
>> /usr/bin/logger -p daemon.info-i -t${0##*/} "Debug: $DBNAME
>> cron.daily checking started."
>>
>> /usr/bin/mysqlcheck $DEBIAN -s $DBNAME
>>
>> # Debug:
>> /usr/bin/logger -p daemon.info-i -t${0##*/} "Debug: $DBNAME
>> cron.daily checking finished, backup starting."
>>
>> /usr/share/mythtv/mythconverg_backup.pl--directory
>> "/mnt/savaidh/ldrive/Backups/MythTV_db_backup/mypvr"
>>
>> /usr/bin/logger -p daemon.info-i -t${0##*/} "$DBNAME checked and
>> backedup."
>>
>> # End of file.
>>
>>
>> The real work is done by the /usr/share/mythtv/mythconverg_backup.pl
>> script, which is where the default rotation is set.  Use
>>
>>   /usr/share/mythtv/mythconverg_backup.pl--help
>>
>> and
>>
>>   /usr/share/mythtv/mythconverg_backup.pl--help --help
>>
>> for help.  It looks like there is a --rotate option to override the
>> default value.
>> _______________________________________________
>> mythtv-users mailing list
>> mythtv-users at mythtv.org
>> http://lists.mythtv.org/mailman/listinfo/mythtv-users
>> http://wiki.mythtv.org/Mailing_List_etiquette
>> MythTV Forums: https://forum.mythtv.org
> Default value is acceptable, mythconverg is not backing up on its
> own, I have to run the script, I can't confirm or deny whether it is
> rotating or not at this point. Do I need to disable MCC backups for mythconverg to run automatic?

I use following script, I think I picked from the wiki as a daily
cronjob. It automatically only keeps the 5 latest. The location is set
through theDB Backups storage group.

#!/bin/bash

cd /home/samba/sysBackup

OPT_MYTHDB='/usr/share/mythtv/mythconverg_backup.pl'
LOG='/var/log/mythtv/backup.log'

echo "Started ${OPT_MYTHDB} on `date`" >> ${LOG}
${OPT_MYTHDB} >> ${LOG}
echo "Finished ${OPT_MYTHDB} on `date`" >> ${LOG}


Tot mails,
  Hika                            mailto:hikavdh at gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens



More information about the mythtv-users mailing list