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