# To create a configfile just copy the code between "### START CFG ###" and "### END CFG ###" # to /etc/automysqlbackup/automysqlbackup.conf. After that you're able to upgrade this script # (copy a new version to its location) without the need for editing it. ### START CFG ### # 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}'` # Password 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" 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 BACKUPDIR="/var/lib/automysqlbackup" # Leave this blank "" if you don't want to copy the files to a second directory. # After the backup is complete, the files are copied "Offsite" using rsync. This option is realy # the DESC option in the rsync command. If you have public ssh in place. You can use # USER@HOST:PATH syntax to copy the backup directory to a remote system. No options for # passing the scp password is in place at this time. # COPYDIR="root@othersystem.org:Backups" COPYDIR="" # Encrypt your backup file by supplying a password. CRYPTPAS="" # 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="user@domain.com" MAILADDR="root" # ============================================================ # === ADVANCED OPTIONS ( Read the doc's below for details )=== #============================================================= # Backup to a common BACKUPDIR and seperate backups by HOSTNAME? BYHOSTNAME=no # List of DBBNAMES for Monthly Backups. MDBNAMES="${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 # Number of monthly backups to retain. KEEPMON=2 # Number of weekly backups to retain. KEEPWEK=5 # 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= # Backup the full schema with data. FULLSCHEMA=yes # Backup configuration file? MYCNF=yes # Define the mysql configuration path MYCNFPATH=/etc/mysql # 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) #PREBACKUP="/etc/mysql-backup-pre" # Command run after backups (uncomment to use) #POSTBACKUP="/etc/mysql-backup-post" ### END CFG ###