debian/0000755000000000000000000000000012136207324007166 5ustar debian/compat0000644000000000000000000000000212136207324010364 0ustar 5 debian/README.Debian0000644000000000000000000000076512136207324011237 0ustar automysqlbackup for Debian ========================== automysqlbackup creates backup every day, week and month for all of your MySQL database, to a configured folder. There's nothing to do but to install this package, and you'll rest assured that you have a way to go back in the history of your database. The package include the adequate cron entries so that it automatically performs the backup as configured. All parameters can be setup by editing the /etc/default/automysqlbackup file debian/control0000644000000000000000000000162112136207324010571 0ustar Source: automysqlbackup Section: admin Priority: extra Maintainer: Thomas Goirand Build-Depends: debhelper (>= 5) Standards-Version: 3.9.3 Vcs-Browser: http://git.debian.org/?p=users/zigo/automysqlbackup.git Vcs-Git: http://git.debian.org/git/users/zigo/automysqlbackup.git Homepage: http://sourceforge.net/projects/automysqlbackup/ Package: automysqlbackup Architecture: all Recommends: mutt Depends: ${misc:Depends}, mysql-client Description: daily, weekly and monthly backup for your MySQL database automysqlbackup creates backup every day, week and month for all of your MySQL database, to a configured folder. There's nothing to do but to install this package, and you'll rest assured that you have a way to go back in the history of your database. . This package may be unsafe if untrusted users may create databases and if no check on the syntax of the name of them is performed. debian/postinst0000644000000000000000000000041412136207324010773 0ustar #!/bin/sh set -e if [ -e /etc/default/automysqlbackup ] ; then . /etc/default/automysqlbackup fi if [ -z "${BACKUPDIR}" ] ; then BACKUPDIR=/var/lib/automysqlbackup fi if [ -d ${BACKUPDIR} ] ; then find ${BACKUPDIR} -type f -exec chmod 600 {} \; fi #DEBHELPER# debian/manpages0000644000000000000000000000003512136207324010702 0ustar debian/man/automysqlbackup.8 debian/defaults0000644000000000000000000000656212136207324010731 0ustar # 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 debian/docs0000644000000000000000000000002512136207324010036 0ustar debian/README.Debian debian/cron.daily0000644000000000000000000000012012136207324011144 0ustar #!/bin/sh test -x /usr/sbin/automysqlbackup || exit 0 /usr/sbin/automysqlbackup debian/Makefile0000644000000000000000000000005012136207324010621 0ustar # .PHONY: dummy tidy: dummy rm -f *~ debian/source/0000755000000000000000000000000012136207324010466 5ustar debian/source/format0000644000000000000000000000001412136207324011674 0ustar 3.0 (quilt) debian/gbp.conf0000644000000000000000000000015412136207324010605 0ustar [DEFAULT] upstream-branch = upstream debian-branch = debian [git-buildpackage] export-dir = ../build-area/ debian/dirs0000644000000000000000000000005612136207324010053 0ustar /var/lib/automysqlbackup /etc/automysqlbackup debian/install0000644000000000000000000000003212136207324010552 0ustar automysqlbackup /usr/sbin debian/watch0000644000000000000000000000014312136207324010215 0ustar version=3 opts=dversionmangle=s/\+debian// \ http://sf.net/automysqlbackup/automysqlbackup.sh.(.+) debian/changelog0000644000000000000000000000757212136207324011053 0ustar automysqlbackup (2.6+debian.3-1) unstable; urgency=high * Fixes: Code injection via unsafe database names inside eval calls, thanks to Axel Beckert for reporting (Closes: #706099). -- Thomas Goirand Thu, 25 Apr 2013 18:34:36 +0800 automysqlbackup (2.6+debian.2-2) unstable; urgency=low * Cronjob exits without error after package removal, thanks to Holger Levsen for reporting the issue and Andreas Beckmann for the patch (Closes: #633450). -- Thomas Goirand Fri, 01 Feb 2013 05:20:13 +0000 automysqlbackup (2.6+debian.2-1) unstable; urgency=low * Doesn't backup the performance_schema and information_schema databases by default anymore (Closes: #673257). * Bumps Standard-Version: to 3.9.3 (no change required). * Added an option to backup routines with --routines (Closes: #631218). -- Thomas Goirand Fri, 25 May 2012 11:42:27 +0000 automysqlbackup (2.6+debian-2) unstable; urgency=low * Now only depends on mysql-client, and not mysql-client-x.x | mysql-client anymore. -- Thomas Goirand Tue, 14 Feb 2012 20:10:54 +0800 automysqlbackup (2.6+debian-1) unstable; urgency=low * New upstream version. With this new Debian release, I'm deciding to completely fork upstream work, as it's being impossible to work with upstream (no responsiveness), that upstream branch diverged, and is still containing the very bad security issue to save DBs dumps as world readable after my repeated warnings. * debian/copyright now using DEP5 format. * Added Vcs fields and a debian/gbp.conf. * Switching to source format 1.0 (quilt). * Removed now useless Dm-Upload-Allowed:, and now using my @debian.org email as maintainer. * Now depends on mysql-client-5.1 | mysql-client (and not 5.0 anymore). * Standards-Version: is now 3.9.2. * Remove "a" article in short description. * Added build-arch: and build-indep: targets in debian/rules. * Fixes Script fails with error when DBNAMES="all", thanks to Chris Moules (Closes: #654388). -- Thomas Goirand Mon, 23 Jan 2012 17:02:38 +0800 automysqlbackup (2.5-6) unstable; urgency=low * Fixes the --opt issue with the information_schema that needs --skip-opt instead of --opt (Closes: #550037). * Added ${misc:Depends}. * Added patch to purge the rotated weekly backups that are older than 5 weeks, if you selected SEPDIR (Separate backup for each DB), thanks to Gregor Hoffleit (Closes: #572642). * Removes verbosivity when doing rm when LATEST is in use, as suggested by Frédéric Brière (Closes: #574479). -- Thomas Goirand Tue, 23 Mar 2010 20:54:27 +0800 automysqlbackup (2.5-5) unstable; urgency=low * Added Recommends: mutt (Closes: #532402). * Now uses a SHOW DATABASES statement to list all DBs to backup in the /etc/defaults/automysqlbackup, which is a lot more reliable than the previous folder listing (Closes: #539370). * Added some quotes in the script to avoid some parsing errors, which was reported by a user of the package (Closes: #534852). * Added more comments in the /etc/defaults/automysqlbackup. * Added a watch file. * Bumped Standards-Version to 3.8.2. -- Thomas Goirand Thu, 06 Aug 2009 12:55:25 +0800 automysqlbackup (2.5-3) unstable; urgency=high * There are now more options in the /etc/defaults/automysqlbackup config file as requested (in fact all advanced options) (Closes: #506135). * Backups are not world readable anymore (chmod 600 after the backup is performed). Thansk to jacques-billard@studio-jibe.com for reporting. -- Thomas Goirand Sun, 22 Mar 2009 18:05:23 +0800 automysqlbackup (2.5-1) unstable; urgency=low * Initial release. (Closes: #497899) -- Thomas Goirand Fri, 5 Sep 2008 15:28:25 +0800 debian/copyright0000644000000000000000000000236612136207324011130 0ustar Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=240 Upstream-Name: automysqlbackup Upstream-Contact: Source: http://sourceforge.net/projects/automysqlbackup/ Files: debian/* Copyright: (c) 2006-2012, Thomas Goirand License: GPL-2+ Files: * Copyright: (c) 2002-2003 (c) 2006-2012, Thomas Goirand License: GPL-2+ License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA . On Debian systems, the complete text of the GNU General Public License (GPL) version 2 may be found in /usr/share/common-licenses/GPL-2. debian/man/0000755000000000000000000000000012136207324007741 5ustar debian/man/automysqlbackup.80000644000000000000000000000477312136207324013271 0ustar .TH automysqlbackup 8 "6 Sep 2008" "wipe_out" "Automatically backup MySQL" .SH NAME automysqlbackup \- backup all of your database daily, weekly, and monthly .SH SYNOPSIS automysqlbackup .br .SH DESCRIPTION This manual page documents briefly the .B automysqlbackup command. .PP configuration is stored within the .RI /etc/default/automysqlbackup file .PP .SH PARAMETERS .br .TP \fBUSERNAME=\fPdbuser Username to access the MySQL server e.g. dbuser .TP \fBPASSWORD=\fP"password" Username to access the MySQL server e.g. password .TP \fBDBHOST=\fPlocalhost Host name (or IP address) of MySQL server e.g localhost .TP \fBDBNAMES=\fP"DB1 DB2 DB3" List of DBNAMES for Daily/Weekly Backup e.g. "DB1 DB2 DB3" .TP \fBBACKUPDIR=\fP"/backups" Backup directory location e.g /backups .br .PP .TP \fBMAILCONTENT=\fP"stdout" 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. .TP \fBMAXATTSIZE=\fP"4000" Set the maximum allowed email size in k. (4000 = approx 5MB email [see docs]) .TP \fBMAILADDR=\fP"user@domain.com" Email Address to send mail to? (user@domain.com) .PP .SH ADVANCED OPTIONS .TP \fBMDBNAMES=\fP"mysql $DBNAMES" List of \fIDBBNAMES\fR for Monthly Backups. .TP \fBDBEXCLUDE=\fP"" List of \fIDBNAMES\fP to EXCLUDE if DBNAMES are set to all (must be in " quotes) .TP \fBCREATE_DATABASE=\fPyes Include CREATE DATABASE in backup? .TP \fBSEPDIR=\fPyes Separate backup directory and file for each DB? (yes or no) .TP \fBDOWEEKLY=\fP6 Which day do you want weekly backups at? (1 to 7 where 1 is Monday) .TP \fBCOMP=\fPgzip Choose Compression type. (gzip or bzip2) .TP \fBCOMMCOMP=\fPno Compress communications between backup server and MySQL server? .TP \fBLATEST\fP=no Additionally keep a copy of the most recent backup in a separate directory. .TP \fBMAX_ALLOWED_PACKET=\fP The maximum size of the buffer for client/server communication. e.g. 16MB (maximum i .TP \fBSOCKET=\fP For connections to localhost. Sometimes the Unix socket file must be specified. .TP \fB#PREBACKUP="/etc/automysqlbackup/mysql-backup-pre" Command to run before backups (uncomment to use) .TP \fB#POSTBACKUP=\fP"/etc/automysqlbackup/mysql-backup-post" Command run after backups (uncomment to use) .SH AUTHOR This manual page was written by Jose Luis Tallon .nh . for the Debian GNU/Linux system, but can be used by others. debian/rules0000755000000000000000000000115212136207324010245 0ustar #!/usr/bin/make -f build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp build-stamp: clean: dh_testdir dh_testroot dh_clean install: dh_testdir dh_testroot dh_installdirs install -D -m 644 debian/defaults debian/automysqlbackup/etc/default/automysqlbackup binary-indep: install dh_testdir dh_testroot dh_install dh_installchangelogs dh_installcron dh_installman dh_installdocs dh_fixperms dh_compress dh_installdeb dh_gencontrol dh_md5sums dh_builddeb binary-arch: install binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install