-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnethserver-automysqlbackup.spec
127 lines (99 loc) · 4.09 KB
/
nethserver-automysqlbackup.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
%define name nethserver-automysqlbackup
%define version 3.0.RC6
%define release 13
%define rpmver 3.0.RC6
Summary:automysqlbackup is a script to backup your msql database on nethserver
Name: %{name}
Version:%{version}
Release:%{release}%{?dist}
License:GPL
Group: /Web/Application
Source: %{name}-%{version}.tar.gz
URL: http://sourceforge.net/projects/automysqlbackup/
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
BuildArchitectures: noarch
Requires: nethserver-mysql
Requires: pax
Requires: pigz
Requires: automysqlbackup
BuildRequires: nethserver-devtools
%description
This RPM is an unofficial addon for the Nethserver
The target audience is the Linux administrator
who wants to backup their mysql databases with an automatic way.
This script is based on automysqlbackup V3.0
%prep
rm -rf $RPM_BUILD_ROOT
%setup
%build
perl createlinks
%{__mkdir} -p root/var/lib/nethserver/automysqlbackup/daily
%{__mkdir} -p root/var/lib/nethserver/automysqlbackup/fullschema
%{__mkdir} -p root/var/lib/nethserver/automysqlbackup/latest
%{__mkdir} -p root/var/lib/nethserver/automysqlbackup/monthly
%{__mkdir} -p root/var/lib/nethserver/automysqlbackup/status
%{__mkdir} -p root/var/lib/nethserver/automysqlbackup/tmp
%{__mkdir} -p root/var/lib/nethserver/automysqlbackup/weekly
%install
/bin/rm -rf $RPM_BUILD_ROOT
(cd root ;/usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT)
/bin/rm -f %{name}-%{version}-filelist
%{genfilelist} $RPM_BUILD_ROOT \
--file /sbin/e-smith/runmysqlbackup 'attr(0750,root,root)' \
> %{name}-%{version}-filelist
%files -f %{name}-%{version}-filelist
%defattr(-,root,root)
%dir %{_nseventsdir}/%{name}-update
%doc COPYING
%config(noreplace) /etc/automysqlbackup/automysqlbackup.conf
%config(noreplace) /etc/automysqlbackup/myserver.conf
%config(noreplace) /etc/automysqlbackup/rh-mariadb101.conf
%config(noreplace) /etc/automysqlbackup/rh-mariadb102.conf
%config(noreplace) /etc/automysqlbackup/rh-mariadb103.conf
%clean
rm -rf $RPM_BUILD_ROOT
%pre
%post
%preun
%postun
if [ $1 = 0 ] ; then
SMEDB=automysqlbackup
MYSQLUSER=backupuser
echo "======================================================================="
echo " delete mysql user and revoque all permissions"
# This section deletes backupuser
mysql -u root -e "REVOKE ALL PRIVILEGES ON *.* FROM '$MYSQLUSER'@'localhost';"
mysql -u root -e "DROP USER $MYSQLUSER@localhost;"
echo " "
# Delete custom template fragment
echo " delete db configuration automysqlbackup"
echo "======================================================================="
/sbin/e-smith/config delete $SMEDB
fi
%changelog
* Sun Nov 29 2020 stephane de Labrusse <[email protected]> 3.0.RC6-13.ns7
- Dump rh-mariadb103 if installed
- config noreplace configuration files
* Tue Aug 21 2018 Stephane de Labrusse <[email protected]> 3.0.RC6-11.ns7
- Create mysql user in mariadb101 & mariadb102
* Sun Jul 9 2018 Stephane de Labrusse <[email protected]> 3.0.RC6-10.ns7
- Dump rh-mariadb101 or rh-mariadb102 if installed
* Thu Nov 9 2017 Stephane de Labrusse <[email protected]> 3.0.RC6-9.ns7
- added pigz as dependency for multicore support
* Mon Mar 27 2017 Stephane de Labrusse <[email protected]> 3.0.RC6-8.ns7
- The cronJob can be set hourly
* Sun Mar 11 2017 Stephane de Labrusse <[email protected]> 3.0.RC6-7.ns7
- GPL license
* Sat Nov 05 2016 Stephane de Labrusse <[email protected]> 3.0.RC6-6.ns7
- First release to NS7
* Thu May 21 2015 Stephane de Labrusse <[email protected]> 3.0.RC6-5
- First release to Neth
* Sun Aug 17 2014 Stephane de Labrusse <[email protected]> 3.0.RC6-4
- added my own patch against the --events warning
--Warning: Skipping the data of table mysql.event. Specify the --events option explicitly.
* Sun Oct 27 2013 Stephane de Labrusse <[email protected]> 3.0.RC6.3
- split the contrib in two versions smeserver-automysqlbackup and automysqlbackup
* Mon Apr 22 2013 Stephane de Labrusse <[email protected]>
- [3.0.RC6] version Based on automysqlbackup V3.0 RC6
* Mon Apr 08 2013 Stephane de Labrusse <[email protected]>
- [0.01] Initial version Based on automysqlbackup V3.0 RC6