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