213 lines
8.0 KiB
RPMSpec
213 lines
8.0 KiB
RPMSpec
%define name smeserver-automysqlbackup
|
|
%define version 3.0.RC6
|
|
%define release 34
|
|
%define rpmver 3.0.RC6
|
|
|
|
epoch: 2
|
|
Summary: automysqlbackup is a script to backup your msql database on sme8
|
|
Name: %{name}
|
|
Version: %{version}
|
|
Release: %{release}%{?dist}
|
|
License: GPL
|
|
Group: /Web/Application
|
|
Source: %{name}-%{version}.tar.xz
|
|
URL: http://sourceforge.net/projects/automysqlbackup/
|
|
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
|
|
BuildArchitectures: noarch
|
|
Requires: smeserver-release >= 10
|
|
Requires: pax
|
|
Requires: automysqlbackup >= 3.0.RC6-8
|
|
BuildRequires: smeserver-devtools
|
|
|
|
%description
|
|
This RPM is an unofficial addon for the SME Server 10.x.
|
|
The target audience is the Linux/E-smith administrator
|
|
who wants to backup their mysql databases with an automatic way.
|
|
This script is based on automysqlbackup V3.0
|
|
|
|
%changelog
|
|
* Sun Sep 08 2024 fix-e-smith-pkg.sh by Trevor Batley <trevor@batley.id.au> 3.0.RC6-34.sme
|
|
- Fix e-smith references in smeserver-automysqlbackup [SME: 12732]
|
|
|
|
* Sat Sep 07 2024 cvs2git.sh aka Brian Read <brianr@koozali.org> 3.0.RC6-33.sme
|
|
- Roll up patches and move to git repo [SME: 12338]
|
|
|
|
* Sat Sep 07 2024 BogusDateBot
|
|
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
|
|
by assuming the date is correct and changing the weekday.
|
|
|
|
* Wed Jun 14 2023 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-32.sme
|
|
- Add create_database to backups
|
|
|
|
* Tue Oct 04 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-31.sme
|
|
- Remove myserver.conf template expansion as template no longer exists
|
|
|
|
* Mon Aug 22 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-30.sme
|
|
- Forgot to change the version on the Changelog line below
|
|
|
|
* Mon Aug 22 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-29.sme
|
|
- Bump automysqlbackup requires
|
|
|
|
* Mon Aug 15 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-28.sme
|
|
- Add debug patch to conf files
|
|
|
|
* Mon Aug 15 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-27.sme
|
|
- Modify cron line again to add -bc option [SME: 11970]
|
|
- Modify runmysqlbackup to add option and conf input from cron
|
|
|
|
* Mon Aug 08 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-26.sme
|
|
- Change cron directories to match templates [SME:11970]
|
|
|
|
* Mon Aug 08 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-25.sme
|
|
- Change rc2 to RC6 in config templates [SME:11970]
|
|
- Fix DONT'T typo
|
|
|
|
* Tue Jun 07 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-24.sme
|
|
- Update cron [SME:11970]
|
|
- Fix SQL in Maria 105
|
|
- Remove automysql event and leave just smeserver-automysqlbackup-update
|
|
- Fix some createlinks
|
|
- Modify inits - but still leaves log errors if version not installed
|
|
|
|
* Tue Jun 07 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-23.sme
|
|
- Modify backup directory names [SME: 11970]
|
|
|
|
* Tue May 31 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-22.sme
|
|
- Fix more typos in templates [SME: 11970]
|
|
|
|
* Tue May 31 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-21.sme
|
|
- Fix typos in templates [SME: 11970]
|
|
|
|
* Mon May 30 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-20.sme
|
|
- Correct template names [SME: 11970]
|
|
- Add enable instructions
|
|
|
|
* Mon May 09 2022 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-19.sme
|
|
- Add Maria DB 10.x support [SME: 11970]
|
|
- Requires Koozali SME Server v10.x
|
|
|
|
* Sat Jun 05 2021 Terry Fage <terryf@ozemail.com.au> 3.0.RC6-18.sme
|
|
- mariadb should not backup information_schema [SME: 11622]
|
|
|
|
* Fri Apr 16 2021 Jean-Philippe Pialasse <tests@pialasse.com> 3.0.RC6-17.sme
|
|
- fix automysql freeze server on reboot after post-upgrade event [SME: 11561]
|
|
|
|
* Mon Oct 19 2020 Brian Read <brianr@bjsystems.co.uk> 3.0-RC6-16.sme
|
|
- Initial Import to SME10 tree [SME: 11042]
|
|
- Update-MySQL-Init-for-Mariadb
|
|
|
|
* Sun Sep 22 2019 Jean-Philipe Pialasse <tests@pialasse.com> 3.0.RC6-15.sme
|
|
- fix multiple cause of error noise and performance [SME: 10806]
|
|
* avoid parallel run of all backups, cron template rewritten
|
|
* avoid multiple parallel or repeated chmod and chown
|
|
* protect from undesired chmod or chown
|
|
* consistent use of status for cron and conf templates
|
|
* create backup user for mysql, mysql55 and mysql57 (Maria to do)
|
|
* update mysql53 use to mysql51 as variable
|
|
* migrate fragment to remove Mysql55 Mysql57 Mymaria Mysql53 if Mysql53 exist
|
|
* remove default value in db for Mysql55 Mysql57 Mymaria Mysql53
|
|
* default as enabled in fragments for all automysql My* properties
|
|
- create default user in dbs [SME: 10808]
|
|
- tidy spec file
|
|
|
|
* Mon Nov 26 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-11.sme
|
|
- fix runmysqlscript to allow for change in Backupdir key [SME: 10655]
|
|
|
|
* Mon Nov 26 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-10.sme
|
|
- fix runmysqlbackup to allow for new databases [SME: 10654]
|
|
|
|
* Fri Jul 06 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-9.sme
|
|
- Template configuration files
|
|
- run automysqlbackup per conf directly from cron rather than runmysqlbackup
|
|
- Add extra DB keys for mysql53, mysql55, mysql57
|
|
|
|
* Sun Apr 02 2017 stephane de Labrusse <stephdl@de-labrusse.fr> 3.0.RC6-8.sme
|
|
- Added smeserver-automysqlbackup-AdjustableCronJob.patch
|
|
- The time to run the Job is adjustable
|
|
|
|
* Wed Sep 16 2015 stephane de Labrusse <stephdl@de-labrusse.fr> 3.0.RC6-6.sme
|
|
- Added 'epoch: 2'
|
|
|
|
* Sat Aug 22 2015 stephane de Labrusse <stephdl@de-labrusse.fr> 3.0.RC6-5.sme
|
|
- Initial release to contribs9
|
|
|
|
* Sun Aug 17 2014 Stephane de Labrusse <stephdl@de-labrusse.fr> 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 <stephdl@de-labrusse.fr> 3.0.RC6.3
|
|
- split the contrib in two versions smeserver-automysqlbackup and automysqlbackup
|
|
* Mon Apr 22 2013 Stephane de Labrusse <stephdl@de-labrusse.fr>
|
|
- [3.0.RC6] version Based on automysqlbackup V3.0 RC6
|
|
* Mon Apr 08 2013 Stephane de Labrusse <stephdl@de-labrusse.fr>
|
|
- [0.01] Initial version Based on automysqlbackup V3.0 RC6
|
|
|
|
%prep
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
%setup
|
|
|
|
%build
|
|
perl createlinks
|
|
find . \( -name .gitinclude -o -name .gitignore \) -print0 | \
|
|
xargs -0 rm -f
|
|
|
|
%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
|
|
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
|
|
--file /sbin/e-smith/runmysqlbackup 'attr(0750,root,root)' \
|
|
--dir /root/backup 'attr(0700,root,root)' \
|
|
--dir /root/backup/db 'attr(0700,root,root)' \
|
|
--dir /root/backup/db/daily 'attr(0700,root,root)' \
|
|
--dir /root/backup/db/fullschema 'attr(0700,root,root)' \
|
|
--dir /root/backup/db/latest 'attr(0700,root,root)' \
|
|
--dir /root/backup/db/monthly 'attr(0700,root,root)' \
|
|
--dir /root/backup/db/status 'attr(0700,root,root)' \
|
|
--dir /root/backup/db/tmp 'attr(0700,root,root)' \
|
|
--dir /root/backup/db/weekly 'attr(0700,root,root)' \
|
|
> %{name}-%{version}-filelist
|
|
|
|
|
|
%files -f %{name}-%{version}-filelist
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%clean
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
%pre
|
|
|
|
%post
|
|
#protect the backup folder
|
|
chmod -R 700 /root/backup
|
|
echo "======================================================================="
|
|
echo " "
|
|
echo " To update your templates please run"
|
|
echo " 'signal-event smeserver-automysqlbackup-update'"
|
|
echo " "
|
|
echo "======================================================================="
|
|
|
|
%preun
|
|
%postun
|
|
if [ $1 = 0 ] ; then
|
|
SMEDB=automysqlbackup
|
|
MYSQLUSER=backupuser
|
|
echo "======================================================================="
|
|
echo " "
|
|
echo " delete mysql user and revoke all permissions"
|
|
# This section deletes backupuser for the standard DB
|
|
mysql -u root -e "REVOKE ALL PRIVILEGES ON *.* FROM '$MYSQLUSER'@'localhost';"
|
|
mysql -u root -e "DROP USER $MYSQLUSER@localhost;"
|
|
echo " "
|
|
echo "Do that for each DB - e.g mysq55, mysql57, mariadb101, maria105 etc"
|
|
echo " "
|
|
# Delete custom template fragment
|
|
echo " Deleting configuration automysqlbackup"
|
|
echo " "
|
|
echo "======================================================================="
|
|
|
|
/sbin/e-smith/config delete $SMEDB
|
|
fi
|