From 112782ca33a21fb7c49ccadfccaef1b6ceac6bc0 Mon Sep 17 00:00:00 2001 From: mhoellein Date: Tue, 10 Sep 2019 08:42:20 +0200 Subject: [PATCH] committing changes in /etc after apt run Package changes: +automysqlbackup 2.6+debian.4-1 all --- .etckeeper | 4 ++ cron.daily/automysqlbackup | 3 ++ default/automysqlbackup | 92 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100755 cron.daily/automysqlbackup create mode 100644 default/automysqlbackup diff --git a/.etckeeper b/.etckeeper index bb2ba281..c4335978 100755 --- a/.etckeeper +++ b/.etckeeper @@ -13,6 +13,7 @@ mkdir -p './X11/xkb' mkdir -p './apparmor.d/force-complain' mkdir -p './apt/auth.conf.d' mkdir -p './at-spi2' +mkdir -p './automysqlbackup' mkdir -p './binfmt.d' mkdir -p './brltty/Input/xw' mkdir -p './cups/interfaces' @@ -1133,6 +1134,7 @@ maybe chmod 0640 'asterisk/xmpp.conf' maybe chmod 0755 'at-spi2' maybe chgrp 'daemon' 'at.deny' maybe chmod 0640 'at.deny' +maybe chmod 0755 'automysqlbackup' maybe chmod 0755 'avahi' maybe chmod 0755 'avahi/avahi-autoipd.action' maybe chmod 0644 'avahi/avahi-daemon.conf' @@ -2012,6 +2014,7 @@ maybe chmod 0755 'cron.daily/0anacron' maybe chmod 0755 'cron.daily/apache2' maybe chmod 0755 'cron.daily/apt-compat' maybe chmod 0755 'cron.daily/aptitude' +maybe chmod 0755 'cron.daily/automysqlbackup' maybe chmod 0755 'cron.daily/bsdmainutils' maybe chmod 0755 'cron.daily/cracklib-runtime' maybe chmod 0755 'cron.daily/devolo-updates' @@ -2136,6 +2139,7 @@ maybe chmod 0644 'default/apache-htcacheclean' maybe chmod 0644 'default/apcupsd' maybe chmod 0644 'default/arpwatch' maybe chmod 0644 'default/asterisk' +maybe chmod 0644 'default/automysqlbackup' maybe chmod 0644 'default/autossh' maybe chmod 0644 'default/avahi-daemon' maybe chmod 0644 'default/batmand' diff --git a/cron.daily/automysqlbackup b/cron.daily/automysqlbackup new file mode 100755 index 00000000..69c61469 --- /dev/null +++ b/cron.daily/automysqlbackup @@ -0,0 +1,3 @@ +#!/bin/sh +test -x /usr/sbin/automysqlbackup || exit 0 +/usr/sbin/automysqlbackup diff --git a/default/automysqlbackup b/default/automysqlbackup new file mode 100644 index 00000000..549e87c8 --- /dev/null +++ b/default/automysqlbackup @@ -0,0 +1,92 @@ +# By default, the Debian version of automysqlbackup will use: +# mysqldump --defaults-file=/etc/mysql/debian.cnf +# but you might want to overwrite with a specific user & pass. +# To do this, simply edit bellow. + +# Username to access the MySQL server e.g. dbuser +#USERNAME=`grep user /etc/mysql/debian.cnf | tail -n 1 | cut -d"=" -f2 | awk '{print $1}'` + +# Username to access the MySQL server e.g. password +#PASSWORD=`grep password /etc/mysql/debian.cnf | tail -n 1 | cut -d"=" -f2 | awk '{print $1}'` + +# Host name (or IP address) of MySQL server e.g localhost +DBHOST=localhost + +# List of DBNAMES for Daily/Weekly Backup e.g. "DB1 DB2 DB3" +# Note that it's absolutely normal that the db named "mysql" is not in this +# list, as it's added later by the script. See the MDBNAMES directives below +# in this file (advanced options). +# This is ONLY a convenient default, if you don't like it, don't complain +# and write your own. +# The following is a quick hack that will find the names of the databases by +# reading the mysql folder content. Feel free to replace by something else. +# DBNAMES=`find /var/lib/mysql -mindepth 1 -maxdepth 1 -type d | cut -d'/' -f5 | grep -v ^mysql\$ | tr \\\r\\\n ,\ ` +# This one does a list of dbs using a MySQL statement. +DBNAMES=`mysql --defaults-file=/etc/mysql/debian.cnf --execute="SHOW DATABASES" | awk '{print $1}' | grep -v ^Database$ | grep -v ^mysql$ | grep -v ^performance_schema$ | grep -v ^information_schema$ | tr \\\r\\\n ,\ ` + +# Backup directory location e.g /backups +# Folders inside this one will be created (daily, weekly, etc.), and the +# subfolders will be database names. Note that backups will be owned by +# root, with Unix rights 0600. +BACKUPDIR="/var/lib/automysqlbackup" + +# Mail setup +# What would you like to be mailed to you? +# - log : send only log file +# - files : send log file and sql files as attachments (see docs) +# - stdout : will simply output the log to the screen if run manually. +# - quiet : Only send logs if an error occurs to the MAILADDR. +MAILCONTENT="quiet" + +# Set the maximum allowed email size in k. (4000 = approx 5MB email [see +# docs]) +MAXATTSIZE="4000" + +# Email Address to send mail to? (user@domain.com) +MAILADDR="root" + +# ============================================================ +# === ADVANCED OPTIONS ( Read the doc's below for details )=== +#============================================================= + +# List of DBBNAMES for Monthly Backups. +MDBNAMES="mysql $DBNAMES" + +# List of DBNAMES to EXLUCDE if DBNAMES are set to all (must be in " quotes) +DBEXCLUDE="" + +# Include CREATE DATABASE in backup? +CREATE_DATABASE=yes + +# Separate backup directory and file for each DB? (yes or no) +SEPDIR=yes + +# Which day do you want weekly backups? (1 to 7 where 1 is Monday) +DOWEEKLY=6 + +# Choose Compression type. (gzip or bzip2) +COMP=gzip + +# Compress communications between backup server and MySQL server? +COMMCOMP=no + +# Additionally keep a copy of the most recent backup in a seperate +# directory. +LATEST=no + +# The maximum size of the buffer for client/server communication. e.g. 16MB +# (maximum is 1GB) +MAX_ALLOWED_PACKET= + +# For connections to localhost. Sometimes the Unix socket file must be +# specified. +SOCKET= + +# Command to run before backups (uncomment to use) +#PREBACKUP="/etc/mysql-backup-pre" + +# Command run after backups (uncomment to use) +#POSTBACKUP="/etc/mysql-backup-post" + +# Backup of stored procedures and routines (comment to remove) +ROUTINES=yes -- 2.43.0