--- 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 17:18:49 1.9 @@ -1,6 +1,6 @@ %define name smeserver-automysqlbackup %define version 3.0.RC6 -%define release 8 +%define release 13 %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,30 @@ This script is based on automysqlbackup %changelog +* Sun Sep 22 2019 Jean-Philipe Pialasse 3.0.RC6-13.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] + +* 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,6 +83,10 @@ rm -rf $RPM_BUILD_ROOT %setup %patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 %build perl createlinks @@ -77,18 +110,6 @@ 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 @@ -99,13 +120,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