1 |
%define name smeserver-automysqlbackup |
2 |
%define version 3.0.RC6 |
3 |
%define release 24 |
4 |
%define rpmver 3.0.RC6 |
5 |
|
6 |
epoch: 2 |
7 |
Summary: automysqlbackup is a script to backup your msql database on sme8 |
8 |
Name: %{name} |
9 |
Version: %{version} |
10 |
Release: %{release}%{?dist} |
11 |
License: GPL |
12 |
Group: /Web/Application |
13 |
Source: %{name}-%{version}.tar.gz |
14 |
URL: http://sourceforge.net/projects/automysqlbackup/ |
15 |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
16 |
BuildArchitectures: noarch |
17 |
Requires: e-smith-base, e-smith-release >= 10 |
18 |
Requires: pax |
19 |
Requires: automysqlbackup |
20 |
BuildRequires: e-smith-devtools |
21 |
Patch0: smeserver-automysqlbackup-AdjustableCronJob.patch |
22 |
Patch1: smeserver-automysqlbackup-enhanced-templates.patch |
23 |
Patch2: smeserver-automysqlbackup-fix-runmysql.patch |
24 |
Patch3: smeserver-automysqlbackup-update-permission-change.patch |
25 |
Patch4: smeserver-automysqlbackup-3.0.RC6-bz10806.errorsAndCreateUsers.patch |
26 |
Patch5: smeserver-automysqlbackup-3.0.RC6-Update-MySQL-Init-for-Mariadb.patch |
27 |
Patch6: smeserver-automysqlbackup-3.0.RC6-bz11561.patch |
28 |
Patch7: smeserver-automysqlbackup-3.0.RC6-bz11622.patch |
29 |
Patch8: smeserver-automysqlbackup-3.0.RC6-bz11970.Add-Maria-10x-support.patch |
30 |
Patch9: smeserver-automysqlbackup-3.0.RC6-bz11970.Add-Maria-10x-rename-templates.patch |
31 |
Patch10: smeserver-automysqlbackup-3.0.RC6-bz11970.update-cron.patch |
32 |
|
33 |
%description |
34 |
This RPM is an unofficial addon for the SME Server 10.x. |
35 |
The target audience is the Linux/E-smith administrator |
36 |
who wants to backup their mysql databases with an automatic way. |
37 |
This script is based on automysqlbackup V3.0 |
38 |
|
39 |
|
40 |
%changelog |
41 |
* Tue Jun 07 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-24.sme |
42 |
- Update cron [SME:11970] |
43 |
- Fix SQL in Maria 105 |
44 |
- Remove automysql event and leave just smeserver-automysqlbackup-update |
45 |
- Fix some createlinks |
46 |
- Modify inits - but still leaves log errors if version not installed |
47 |
|
48 |
* Tue Jun 07 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-23.sme |
49 |
- Modify backup directory names [SME: 11970] |
50 |
|
51 |
* Tue May 31 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-22.sme |
52 |
- Fix more typos in templates [SME: 11970] |
53 |
|
54 |
* Tue May 31 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-21.sme |
55 |
- Fix typos in templates [SME: 11970] |
56 |
|
57 |
* Mon May 30 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-20.sme |
58 |
- Correct template names [SME: 11970] |
59 |
- Add enable instructions |
60 |
|
61 |
* Mon May 09 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-19.sme |
62 |
- Add Maria DB 10.x support [SME: 11970] |
63 |
- Requires Koozali SME Server v10.x |
64 |
|
65 |
* Sat Jun 05 2021 Terry Fage <terryf@ozemail.com.au> 3.0.RC6-18.sme |
66 |
- mariadb should not backup information_schema [SME: 11622] |
67 |
|
68 |
* Fri Apr 16 2021 Jean-Philippe Pialasse <tests@pialasse.com> 3.0.RC6-17.sme |
69 |
- fix automysql freeze server on reboot after post-upgrade event [SME: 11561] |
70 |
|
71 |
* Mon Oct 19 2020 Brian Read <brianr@bjsystems.co.uk> 3.0-RC6-16.sme |
72 |
- Initial Import to SME10 tree [SME: 11042] |
73 |
- Update-MySQL-Init-for-Mariadb |
74 |
|
75 |
* Sun Sep 22 2019 Jean-Philipe Pialasse <tests@pialasse.com> 3.0.RC6-15.sme |
76 |
- fix multiple cause of error noise and performance [SME: 10806] |
77 |
* avoid parallel run of all backups, cron template rewritten |
78 |
* avoid multiple parallel or repeated chmod and chown |
79 |
* protect from undesired chmod or chown |
80 |
* consistent use of status for cron and conf templates |
81 |
* create backup user for mysql, mysql55 and mysql57 (Maria to do) |
82 |
* update mysql53 use to mysql51 as variable |
83 |
* migrate fragment to remove Mysql55 Mysql57 Mymaria Mysql53 if Mysql53 exist |
84 |
* remove default value in db for Mysql55 Mysql57 Mymaria Mysql53 |
85 |
* default as enabled in fragments for all automysql My* properties |
86 |
- create default user in dbs [SME: 10808] |
87 |
- tidy spec file |
88 |
|
89 |
* Mon Nov 26 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-11.sme |
90 |
- fix runmysqlscript to allow for change in Backupdir key [SME: 10655] |
91 |
|
92 |
* Mon Nov 26 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-10.sme |
93 |
- fix runmysqlbackup to allow for new databases [SME: 10654] |
94 |
|
95 |
* Fri Jul 06 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-9.sme |
96 |
- Template configuration files |
97 |
- run automysqlbackup per conf directly from cron rather than runmysqlbackup |
98 |
- Add extra DB keys for mysql53, mysql55, mysql57 |
99 |
|
100 |
* Sun Apr 02 2017 stephane de Labrusse <stephdl@de-labrusse.fr> 3.0.RC6-8.sme |
101 |
- Added smeserver-automysqlbackup-AdjustableCronJob.patch |
102 |
- The time to run the Job is adjustable |
103 |
|
104 |
* Wed Sep 16 2015 stephane de Labrusse <stephdl@de-labrusse.fr> 3.0.RC6-6.sme |
105 |
- Added 'epoch: 2' |
106 |
|
107 |
* Sat Aug 22 2015 stephane de Labrusse <stephdl@de-labrusse.fr> 3.0.RC6-5.sme |
108 |
- Initial release to contribs9 |
109 |
|
110 |
* Sun Aug 17 2014 Stephane de Labrusse <stephdl@de-labrusse.fr> 3.0.RC6-4 |
111 |
- added my own patch against the --events warning |
112 |
--Warning: Skipping the data of table mysql.event. Specify the --events option explicitly. |
113 |
|
114 |
* Sun Oct 27 2013 Stephane de Labrusse <stephdl@de-labrusse.fr> 3.0.RC6.3 |
115 |
- split the contrib in two versions smeserver-automysqlbackup and automysqlbackup |
116 |
* Mon Apr 22 2013 Stephane de Labrusse <stephdl@de-labrusse.fr> |
117 |
- [3.0.RC6] version Based on automysqlbackup V3.0 RC6 |
118 |
* Mon Apr 08 2013 Stephane de Labrusse <stephdl@de-labrusse.fr> |
119 |
- [0.01] Initial version Based on automysqlbackup V3.0 RC6 |
120 |
|
121 |
%prep |
122 |
rm -rf $RPM_BUILD_ROOT |
123 |
|
124 |
%setup |
125 |
%patch0 -p1 |
126 |
%patch1 -p1 |
127 |
%patch2 -p1 |
128 |
%patch3 -p1 |
129 |
%patch4 -p1 |
130 |
%patch5 -p1 |
131 |
%patch6 -p1 |
132 |
%patch7 -p1 |
133 |
%patch8 -p1 |
134 |
%patch9 -p1 |
135 |
%patch10 -p1 |
136 |
|
137 |
%build |
138 |
perl createlinks |
139 |
find . \( -name .gitinclude -o -name .gitignore \) -print0 | \ |
140 |
xargs -0 rm -f |
141 |
|
142 |
%install |
143 |
/bin/rm -rf $RPM_BUILD_ROOT |
144 |
(cd root ;/usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT) |
145 |
/bin/rm -f %{name}-%{version}-filelist |
146 |
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ |
147 |
--file /sbin/e-smith/runmysqlbackup 'attr(0750,root,root)' \ |
148 |
--dir /root/backup 'attr(0700,root,root)' \ |
149 |
--dir /root/backup/db 'attr(0700,root,root)' \ |
150 |
--dir /root/backup/db/daily 'attr(0700,root,root)' \ |
151 |
--dir /root/backup/db/fullschema 'attr(0700,root,root)' \ |
152 |
--dir /root/backup/db/latest 'attr(0700,root,root)' \ |
153 |
--dir /root/backup/db/monthly 'attr(0700,root,root)' \ |
154 |
--dir /root/backup/db/status 'attr(0700,root,root)' \ |
155 |
--dir /root/backup/db/tmp 'attr(0700,root,root)' \ |
156 |
--dir /root/backup/db/weekly 'attr(0700,root,root)' \ |
157 |
> %{name}-%{version}-filelist |
158 |
|
159 |
|
160 |
%files -f %{name}-%{version}-filelist |
161 |
|
162 |
%defattr(-,root,root) |
163 |
|
164 |
%clean |
165 |
rm -rf $RPM_BUILD_ROOT |
166 |
|
167 |
%pre |
168 |
|
169 |
%post |
170 |
|
171 |
#protect the backup folder |
172 |
chmod -R 700 /root/backup |
173 |
|
174 |
%preun |
175 |
%postun |
176 |
if [ $1 = 0 ] ; then |
177 |
SMEDB=automysqlbackup |
178 |
MYSQLUSER=backupuser |
179 |
echo "=======================================================================" |
180 |
echo " " |
181 |
echo " delete mysql user and revoke all permissions" |
182 |
# This section deletes backupuser for the standard DB |
183 |
mysql -u root -e "REVOKE ALL PRIVILEGES ON *.* FROM '$MYSQLUSER'@'localhost';" |
184 |
mysql -u root -e "DROP USER $MYSQLUSER@localhost;" |
185 |
echo " " |
186 |
echo "Do that for each DB - e.g mysq55, mysql57, mariadb101, maria105 etc" |
187 |
echo " " |
188 |
# Delete custom template fragment |
189 |
echo " Deleting configuration automysqlbackup" |
190 |
echo " " |
191 |
echo "=======================================================================" |
192 |
|
193 |
/sbin/e-smith/config delete $SMEDB |
194 |
fi |