1#=====================================================================
2# Change Log
3#=====================================================================
4#
5# version 3.0_rc4 - (2011-11-24)
6#     - Removing mkfifo commands, thereby improving portability.
7#     - Fixing not working table exclude feature for wildcards.
8# version 3.0_rc3 - (2011-11-24)
9#     - Changed code to make it more portable, thereby resolving FreeBSD issue.
10# version 3.0_rc2 - (2011-11-21)
11#     - Added multicore support for bzip and gzip2.
12#     - Fixed error in README file.
13# version 3.0_rc1 - (2011-11-15)
14#     - Added differential backup method.
15#     - Added user-friendly method to recreate full backups out of differential ones.
16#     - Changed paramters, with which the script can be called, to make the new
17#       methods available.
18#     - Fixed some bugs.
19# version 3.0_beta2 - (2011-08-21)
20#     - Added possibility to backup local files.
21#     - Added full schema backup.
22#     - Added master-data option.
23#     - Fixed some bugs.
24# version 3.0_beta1 - (2011-08-15)
25#     - REMOVED: Implementation of Variables containing full path to binaries to
26#       avoid possibly confusion with aliases or builtins. (by Johannes Kolter)
27#       Inside a bash script no aliases are used! This didn't make ANY sense!
28#       Thereby resolved bug item #3074425.
29#     - Changed some variables to be arrays, i.e. lists, and removed the ugly
30#       sed stuff.
31#       Fixed bug item #3169562
32#     - Added check for weekly and monthly backups, so that they are unique per day.
33#       bug item #3185389
34#     - Changed SHEBANG to #!/usr/bin/env bash  for portability reasons.
35#       bug item #3292873
36#     - Changed config file structure: read /etc/automysqlbackup/mysqlbackup.conf,
37#       if supplied read configfile parameter (no more -c or sth. like that, just
38#       the name of the file!),
39#       whatever isn't set yet, set in here to default values.
40#     - bug item #3110715: create a file in /etc/cron.d/daily and call the script
41#       from in there, i.e. place the script in /usr/local/bin
42#     - bug item #3082899: the PATH variables are different in ssh, you have to
43#       supply the complete path
44#     - Fixed bug item #3064547, suggestion accepted.
45#     - Fixed bug item #3031023, suggestion accepted.
46#     - Fixed bug item #3030604, resolved due to design correction.
47#     - Fixed bug item #3025849, as long as basename is in $PATH on your system.
48#     - Fixed bug item #3030478.
49#     - bug item #3054633: .muttrc entry save=yes will result in saving sent files!
50#     - Feature request item #1538588.
51#     - Feature request item #1538138.
52#     - Feature request item #1538142.
53#     - Feature request item #1541843 was already included.
54#     - Feature request item #2808012.
55#     - Feature request item #2831465.
56#     - Feature request item #3052484. Mysqldump already has an ssl option.
57#     - Feature request item #3190079. I hope cleaning up everything older than 24
58#       hours as a lower limit is good enough.
59#     - Feature request item #3284779 was already included. See CONFIG_mysql_dump_latest.
60#     - Feature request item #3053623.
61# version 2.6.0 - (2011-07-19)
62#     - Fixed bug where files would not email correctly (Fix by Jesse Vaughan)
63#     - Added section to encrypt .gz and .bz2 files using openssl (added by Jesse Vaughan)
64# version 2.5.1-01 - (2010-07-06)
65#     - Fixed pathname bug item #3025849 (by Johannes Kolter)
66# version 2.5.1 - (2010-07-04)
67#     - Added support for default and optional config file (by Johannes Kolter)
68#     - Rotating after backup was successful whith find(1) (by Johannes Kolter)
69#     - Implementation of Variables containing full path to binaries to
70#       avoid possibly confusion with aliases or builtins. (by Johannes Kolter)
71#     - Fixed bug where weekly backups were not being rotated.
72#       Added rotation of 5 monthly backups
73#       Now all old backups are deleted, not only the most recent one
74#       (inspired by oleg@bintime.com)
75#     - Use Debian special-file to access database (by Johannes Kolter)
76#     - Fixed bug ID: 1438565
77#       Moved IO redirection to a place before decicions are made and actions are taken.
78#       (inspired by Derk Bernhardt)
79#     - Fixed bug ID: #3000316 (reported by Sascha Feldhorst)
80#     - Fixed bug ID: #1529458 (reported by Natalie ( njwood ))
81#     - Fixed bug ID: #1548919 (reported by Piotr Kuczynski)
82# version 2.5 - (2006-01-15)
83#		Added support for setting MAXIMUM_PACKET_SIZE and CONFIG_mysql_dump_socket parameters (suggested by Yvo van Doorn)
84# version 2.4 - (2006-01-23)
85#    Fixed bug where weekly backups were not being rotated. (Fix by wolf02)
86#    Added hour an min to backup filename for the case where backups are taken multiple
87#    times in a day. NOTE This is not complete support for mutiple executions of the script
88#    in a single day.
89#    Added MAILCONTENT="quiet" option, see docs for details. (requested by snowsam)
90#    Updated path statment for compatibility with OSX.
91#    Added "CONFIG_mysql_dump_latest" to additionally store the last backup to a standard location. (request by Grant29)
92# version 2.3 - (2005-11-07)
93#    Better error handling and notification of errors (a long time coming)
94#    Compression on Backup server to MySQL server communications.
95# version 2.2 - (2004-12-05)
96#    Changed from using depricated "-N" to "--skip-column-names".
97#    Added ability to have compressed backup's emailed out. (code from Thomas Heiserowski)
98#    Added maximum attachment size setting.
99# version 2.1 - (2004-11-04)
100#    Fixed a bug in daily rotation when not using gzip compression. (Fix by Rob Rosenfeld)
101# version 2.0 - (2004-07-28)
102#    Switched to using IO redirection instead of pipeing the output to the logfile.
103#    Added choice of compression of backups being gzip of bzip2.
104#    Switched to using functions to facilitate more functionality.
105#    Added option of either gzip or bzip2 compression.
106# version 1.10 - (2004-07-17)
107#    Another fix for spaces in the paths (fix by Thomas von Eyben)
108#    Fixed bug when using PREBACKUP and POSTBACKUP commands containing many arguments.
109# version 1.9 - (2004-05-25)
110#    Small bug fix to handle spaces in LOGFILE path which contains spaces (reported by Thomas von Eyben)
111#    Updated docs to mention that Log email can be sent to multiple email addresses.
112# version 1.8 - (2004-05-01)
113#    Added option to make backups restorable to alternate database names
114#    meaning that a copy of the database can be created (Based on patch by Rene Hoffmann)
115#    Seperated options into standard and advanced.
116#    Removed " from single file dump DBMANES because it caused an error but
117#    this means that if DB's have spaces in the name they will not dump when CONFIG_mysql_dump_use_separate_dirs=no.
118#    Added -p option to mkdir commands to create multiple subdirs without error.
119#    Added disk usage and location to the bottom of the backup report.
120# version 1.7 - (2004-04-22)
121#    Fixed an issue where weelky backups would only work correctly if server
122#    locale was set to English (issue reported by Tom Ingberg)
123#    used "eval" for "rm" commands to try and resolve rotation issues.
124#    Changed name of status log so multiple scripts can be run at the same time.
125# version 1.6 - (2004-03-14)
126#   Added PREBACKUP and POSTBACKUP command functions. (patch by markpustjens)
127#   Added support for backing up DB's with Spaces in the name.
128#   (patch by markpustjens)
129# version 1.5 - (2004-02-24)
130#   Added the ability to exclude DB's when the "all" option is used.
131#   (Patch by kampftitan)
132# version 1.4 - (2004-02-02)
133#   Project moved to Sourceforge.net
134# version 1.3 - (2003-09-25)
135#   Added support for backing up "all" databases on the server without
136#    having to list each one seperately in the configuration.
137#   Added DB restore instructions.
138# version 1.2 - (2003-03-16)
139#   Added server name to the backup log so logs from multiple servers
140#   can be easily identified.
141# version 1.1 - (2003-03-13)
142#   Small Bug fix in monthly report. (Thanks Stoyanski)
143#   Added option to email log to any email address. (Inspired by Stoyanski)
144#   Changed Standard file name to .sh extention.
145#   Option are set using yes and no rather than 1 or 0.
146# version 1.0 - (2003-01-30)
147#   Added the ability to have all databases backup to a single dump
148#   file or seperate directory and file for each database.
149#   Output is better for log keeping.
150# version 0.6 - (2003-01-22)
151#   Bug fix for daily directory (Added in version 0.5) rotation.
152# version 0.5 - (2003-01-20)
153#   Added "daily" directory for daily backups for neatness (suggestion by Jason)
154#   Added CONFIG_mysql_dump_host option to allow backing up a remote server (Suggestion by Jason)
155#   Added "--quote-names" option to mysqldump command.
156#   Bug fix for handling the last and first of the year week rotation.
157# version 0.4 - (2002-11-06)
158#   Added the abaility for the script to create its own directory structure.
159# version 0.3 - (2002-10-01)
160#   Changed Naming of Weekly backups so they will show in order.
161# version 0.2 - (2002-09-27)
162#   Corrected weekly rotation logic to handle weeks 0 - 10
163# version 0.1 - (2002-09-21)
164#   Initial Release