--- rpms/smeserver-automysqlbackup/contribs9/smeserver-automysqlbackup.spec 2017/04/02 16:57:21 1.4 +++ rpms/smeserver-automysqlbackup/contribs9/smeserver-automysqlbackup.spec 2019/11/26 18:32:18 1.13 @@ -1,6 +1,6 @@ %define name smeserver-automysqlbackup %define version 3.0.RC6 -%define release 8 +%define release 15 %define rpmver 3.0.RC6 epoch: 2 @@ -19,6 +19,11 @@ Requires: pax Requires: automysqlbackup BuildRequires: e-smith-devtools Patch0: smeserver-automysqlbackup-AdjustableCronJob.patch +Patch1: smeserver-automysqlbackup-enhanced-templates.patch +Patch2: smeserver-automysqlbackup-fix-runmysql.patch +Patch3: smeserver-automysqlbackup-update-permission-change.patch +Patch4: smeserver-automysqlbackup-3.0.RC6-bz10806.errorsAndCreateUsers.patch + %description This RPM is an unofficial addon for the SME Server 9.x. The target audience is the Linux/E-smith administrator @@ -28,6 +33,31 @@ This script is based on automysqlbackup %changelog +* Sun Sep 22 2019 Jean-Philipe Pialasse 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 3.0.RC6-11.sme +- fix runmysqlscript to allow for change in Backupdir key [SME: 10655] + +* Mon Nov 26 2018 John Crisp 3.0.RC6-10.sme +- fix runmysqlbackup to allow for new databases [SME: 10654] + +* Fri Jul 06 2018 John Crisp 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 3.0.RC6-8.sme - Added smeserver-automysqlbackup-AdjustableCronJob.patch - The time to run the Job is adjustable @@ -54,9 +84,15 @@ rm -rf $RPM_BUILD_ROOT %setup %patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 %build perl createlinks +find . \( -name .gitinclude -o -name .gitignore \) -print0 | \ + xargs -0 rm -f %install /bin/rm -rf $RPM_BUILD_ROOT @@ -64,6 +100,15 @@ perl createlinks /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 @@ -77,21 +122,9 @@ rm -rf $RPM_BUILD_ROOT %pre %post -SMEDB=automysqlbackup -MYSQLUSER=backupuser -# Expland template -/etc/e-smith/events/actions/initialize-default-databases -/sbin/e-smith/expand-template /etc/cron.d/runmysqlbackup - -#create backupuser and give rights -MYSQLPASS=$(/sbin/e-smith/config getprop $SMEDB DbPassword) -mysql -e " GRANT EVENT,SELECT,LOCK TABLES ON *.* TO $MYSQLUSER@'localhost' " -mysql -u root -e "SET PASSWORD FOR $MYSQLUSER@localhost = PASSWORD( '$MYSQLPASS' ) " -mysqladmin flush-privileges -/etc/rc.d/init.d/mysql.init start #protect the backup folder -chmod -R 700 /root/backup/db +chmod -R 700 /root/backup %preun %postun @@ -99,13 +132,17 @@ if [ $1 = 0 ] ; then SMEDB=automysqlbackup MYSQLUSER=backupuser echo "=======================================================================" -echo " delete mysql user and revoque all permissions" +echo " " +echo " delete mysql user and revoke 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 " " +echo "Do that for each DB - e.g mysq55, mysql57 etc" +echo " " # Delete custom template fragment echo " delete db configuration automysqlbackup" +echo " " echo "=======================================================================" /sbin/e-smith/config delete $SMEDB