[mythtv-users] mythbuntu db backups

Stephen Worthington stephen_agent at jsw.gen.nz
Fri Oct 30 00:35:35 UTC 2015


On Thu, 29 Oct 2015 18:48:22 -0400, you wrote:

>Greetings Mythizens, in a manual housekeeping effort I've discovered a file
>with ten recent mythbuntu db backups in it, I don't use Mythbuntu Control
>Center any more so these are dead weight. Can anyone offer a suggestion on
>stopping this log rotate process cleanly, I imagine deleting the target
>file would cause subterranean problems at some point. I'm quite happy with
>the Mythconverg backups and I'm running mythtv 0.27 fixes in a Ubuntu 14.04
>desktop environment.  Grazie.

As far as I know, the only backup rotation is done by the backup
script:

  /usr/share/mythtv/mythconverg_backup.pl

which is called from:

  /etc/cron.weekly/mythtv-database

All it does is to do individual backups to files with the date in the
name, and then delete the oldest when it does a new backup and there
are too many backups already present in the destination directory.

There is no software I know of in Mythbuntu 14.04 that will create a
file that has multiple backups in it.

The standard place the backups are put is:

  /var/lib/mythtv/db_backups/

If they are anywhere else, it is something you have done.  I have set
up daily backups to a network drive, and moved my normal weekly
backups to a different drive on my backend.

Exactly how are the multiple backups stored in the file you found? Are
they compressed in some form of archive file?  What is the timestamp
on the file?  Making backups, or archiving them, takes a while, so you
may be able to find out what is doing it by being around at the time
that file is altered, and getting a full process list, and seeing what
is actually creating the file:

  ps -ef >processes.txt

If it is happening at a bad time of day, you can schedule that command
to happen.  To do that, I use a little script called sleepuntil that I
found on the net.  I have it in /usr/local/bin:

#!/bin/bash
set -o nounset

### // Sleep until some date/time.
# // Example: sleepuntil 15:57; kdialog --msgbox "Backup needs to be
done."


error() {
  echo "$@" >&2
  exit 1;
}

NAME_PROGRAM=$(basename "$0")

if [[ $# != 1 ]]; then
     error "ERROR: program \"$NAME_PROGRAM\" needs 1 parameter and it
has received: $#."
fi


CURRENT=$(date +%s)
TARGET=$(date -d "$1" +%s)

SECONDS=$(($TARGET - $CURRENT))

if [[ $SECONDS < 0 ]]; then
     error "You need to specify in a different way the moment in which
this program has to finish, probably indicating the day and the hour
like in this example: $NAME_PROGRAM \"2009/12/30 10:57\"."
fi

sleep "$SECONDS"

# // End of file


So you would do a command like:

sleepuntil 03:00; ps -ef >processes.txt


More information about the mythtv-users mailing list