[mythtv-users] controlling disk space on "/" on mythtv backend
Stephen Worthington
stephen_agent at jsw.gen.nz
Fri Jan 12 01:14:27 UTC 2018
On Thu, 11 Jan 2018 21:08:11 +0000, you wrote:
>On 12 January 2018 5:49:42 am Jim Abernathy <jfabernathy at outlook.com> wrote:
>
>>
>>
>> Question on the cron job for db backup. Is this setup on install of mythtv? I have not created a cron job to do this. But there are a few backups in /var/lib/mythtv/db_backups and I have not run the backup manually yet. I just now ran:
>> /usr/share/mythtv/mythconverg_backup.pl
>> It puts the backup in the directory that I specified in Storage Directories in setup. I just don't know if it's running automatically.
>>
>> Jim A
>>
>>
>As I understand it, no the cron backup is not created automatically by mythtv. However when it does database upgrades it will try very hard to run a backup before doing the upgrade. That may be the few files you see.
I believe the cron job for optimise/repair was created by Mythbuntu
Control Centre. So if you have used that in the past, you are likely
to have set it up that way. But as MCC is no longer supported, anyone
now doing a new install will need to set it up manually.
To install the optimise/repair job on Ubuntu, all you have to do is
this (as root or using sudo):
cp -a
/usr/share/doc/mythtv-backend/contrib/maintenance/optimize_mythdb.pl
/etc/cron.daily/optimize_mythdb
For the database backup job, here is the standard
/etc/cron.weekly/mythtv-database file, which is installed by the
mythtv-database package:
#!/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
backed up."
# End of file.
I prefer to do my database backups daily, and direct them to be stored
on my Windows box over the network. So I have his in
/etc/cron.daily/mythtv-backup:
#!/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/bin/nice -n 2 /usr/local/bin/mythconverg_backup_jsw.pl
--directory "/mnt/savaidh/ldrive/Backups/MythTV_db_backup/mypvr"
--tempdir "/mnt/ssd1/tmp"
/usr/bin/logger -p daemon.info -i -t${0##*/} "$DBNAME checked and
backed up."
# End of file.
More information about the mythtv-users
mailing list