1 |
%define name smeserver-automysqlbackup |
%define name smeserver-automysqlbackup |
2 |
%define version 3.0.RC6 |
%define version 3.0.RC6 |
3 |
%define release 19 |
%define release 30 |
4 |
%define rpmver 3.0.RC6 |
%define rpmver 3.0.RC6 |
5 |
|
|
6 |
epoch: 2 |
epoch: 2 |
15 |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
16 |
BuildArchitectures: noarch |
BuildArchitectures: noarch |
17 |
Requires: e-smith-base, e-smith-release >= 10 |
Requires: e-smith-base, e-smith-release >= 10 |
18 |
Requires: pax |
Requires: pax |
19 |
Requires: automysqlbackup |
Requires: automysqlbackup >= 3.0.RC6-8 |
20 |
BuildRequires: e-smith-devtools |
BuildRequires: e-smith-devtools |
21 |
Patch0: smeserver-automysqlbackup-AdjustableCronJob.patch |
Patch0: smeserver-automysqlbackup-AdjustableCronJob.patch |
22 |
Patch1: smeserver-automysqlbackup-enhanced-templates.patch |
Patch1: smeserver-automysqlbackup-enhanced-templates.patch |
27 |
Patch6: smeserver-automysqlbackup-3.0.RC6-bz11561.patch |
Patch6: smeserver-automysqlbackup-3.0.RC6-bz11561.patch |
28 |
Patch7: smeserver-automysqlbackup-3.0.RC6-bz11622.patch |
Patch7: smeserver-automysqlbackup-3.0.RC6-bz11622.patch |
29 |
Patch8: smeserver-automysqlbackup-3.0.RC6-bz11970.Add-Maria-10x-support.patch |
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 |
|
Patch13: smeserver-automysqlbackup-3.0.RC6-bz11970.update-cron.2.patch |
35 |
|
Patch14: smeserver-automysqlbackup-3.0.RC6-bz11970.Add.Debug.patch |
36 |
|
|
37 |
%description |
%description |
38 |
This RPM is an unofficial addon for the SME Server 10.x. |
This RPM is an unofficial addon for the SME Server 10.x. |
40 |
who wants to backup their mysql databases with an automatic way. |
who wants to backup their mysql databases with an automatic way. |
41 |
This script is based on automysqlbackup V3.0 |
This script is based on automysqlbackup V3.0 |
42 |
|
|
|
|
|
43 |
%changelog |
%changelog |
44 |
* Mon May 09 2022 John Crisp <jcrisp@safeandsoundit.co.uk> |
* Mon Aug 22 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-30.sme |
45 |
|
- Forgot to change the version on the Changelog line below |
46 |
|
|
47 |
|
* Mon Aug 22 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-29.sme |
48 |
|
- Bump automysqlbackup requires |
49 |
|
|
50 |
|
* Mon Aug 15 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-28.sme |
51 |
|
- Add debug patch to conf files |
52 |
|
|
53 |
|
* Mon Aug 15 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-27.sme |
54 |
|
- Modify cron line again to add -bc option [SME: 11970] |
55 |
|
- Modify runmysqlbackup to add option and conf input from cron |
56 |
|
|
57 |
|
* Mon Aug 08 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-26.sme |
58 |
|
- Change cron directories to match templates [SME:11970] |
59 |
|
|
60 |
|
* Mon Aug 08 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-25.sme |
61 |
|
- Change rc2 to RC6 in config templates [SME:11970] |
62 |
|
- Fix DONT'T typo |
63 |
|
|
64 |
|
* Tue Jun 07 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-24.sme |
65 |
|
- Update cron [SME:11970] |
66 |
|
- Fix SQL in Maria 105 |
67 |
|
- Remove automysql event and leave just smeserver-automysqlbackup-update |
68 |
|
- Fix some createlinks |
69 |
|
- Modify inits - but still leaves log errors if version not installed |
70 |
|
|
71 |
|
* Tue Jun 07 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-23.sme |
72 |
|
- Modify backup directory names [SME: 11970] |
73 |
|
|
74 |
|
* Tue May 31 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-22.sme |
75 |
|
- Fix more typos in templates [SME: 11970] |
76 |
|
|
77 |
|
* Tue May 31 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-21.sme |
78 |
|
- Fix typos in templates [SME: 11970] |
79 |
|
|
80 |
|
* Mon May 30 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-20.sme |
81 |
|
- Correct template names [SME: 11970] |
82 |
|
- Add enable instructions |
83 |
|
|
84 |
|
* Mon May 09 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-19.sme |
85 |
- Add Maria DB 10.x support [SME: 11970] |
- Add Maria DB 10.x support [SME: 11970] |
86 |
- Requires Koozali SME Server v10.x |
- Requires Koozali SME Server v10.x |
87 |
|
|
154 |
%patch6 -p1 |
%patch6 -p1 |
155 |
%patch7 -p1 |
%patch7 -p1 |
156 |
%patch8 -p1 |
%patch8 -p1 |
157 |
|
%patch9 -p1 |
158 |
|
%patch10 -p1 |
159 |
|
%patch11 -p1 |
160 |
|
%patch12 -p1 |
161 |
|
%patch13 -p1 |
162 |
|
%patch14 -p1 |
163 |
|
|
164 |
%build |
%build |
165 |
perl createlinks |
perl createlinks |
197 |
|
|
198 |
#protect the backup folder |
#protect the backup folder |
199 |
chmod -R 700 /root/backup |
chmod -R 700 /root/backup |
200 |
|
|
201 |
%preun |
%preun |
202 |
%postun |
%postun |
203 |
if [ $1 = 0 ] ; then |
if [ $1 = 0 ] ; then |
206 |
echo "=======================================================================" |
echo "=======================================================================" |
207 |
echo " " |
echo " " |
208 |
echo " delete mysql user and revoke all permissions" |
echo " delete mysql user and revoke all permissions" |
209 |
# This section deletes backupuser |
# This section deletes backupuser for the standard DB |
210 |
mysql -u root -e "REVOKE ALL PRIVILEGES ON *.* FROM '$MYSQLUSER'@'localhost';" |
mysql -u root -e "REVOKE ALL PRIVILEGES ON *.* FROM '$MYSQLUSER'@'localhost';" |
211 |
mysql -u root -e "DROP USER $MYSQLUSER@localhost;" |
mysql -u root -e "DROP USER $MYSQLUSER@localhost;" |
212 |
echo " " |
echo " " |
213 |
echo "Do that for each DB - e.g mysq55, mysql57 etc" |
echo "Do that for each DB - e.g mysq55, mysql57, mariadb101, maria105 etc" |
214 |
echo " " |
echo " " |
215 |
# Delete custom template fragment |
# Delete custom template fragment |
216 |
echo " delete db configuration automysqlbackup" |
echo " Deleting configuration automysqlbackup" |
217 |
echo " " |
echo " " |
218 |
echo "=======================================================================" |
echo "=======================================================================" |
219 |
|
|