--- rpms/smeserver-automysqlbackup/contribs9/smeserver-automysqlbackup.spec 2019/11/26 03:40:46 1.8 +++ 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 12 +%define release 15 %define rpmver 3.0.RC6 epoch: 2 @@ -33,7 +33,7 @@ This script is based on automysqlbackup %changelog -* Sun Sep 22 2019 Jean-Philipe Pialasse 3.0.RC6-12.sme +* 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 @@ -45,6 +45,7 @@ This script is based on automysqlbackup * 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] @@ -90,6 +91,8 @@ rm -rf $RPM_BUILD_ROOT %build perl createlinks +find . \( -name .gitinclude -o -name .gitignore \) -print0 | \ + xargs -0 rm -f %install /bin/rm -rf $RPM_BUILD_ROOT @@ -97,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 @@ -110,32 +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 - -echo "***********************************************************************" -echo " " -echo "Creating backup user for default mysql53 database" -#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 -echo "done" -echo "*** If you add mysql55/mysql57 you must add a backup user ***" -echo "You can use the password from config show automysqlbackup" -echo "e.g.: " -echo "mysql55 -e \" GRANT EVENT,SELECT,LOCK TABLES ON *.* TO $MYSQLUSER@\'localhost\' \" " -echo "mysql55 -u root -e \"SET PASSWORD FOR $MYSQLUSER@localhost = PASSWORD( \'$MYSQLPASS\' ) \" " -echo " " -echo "***********************************************************************" #protect the backup folder -chmod -R 700 /root/backup/db +chmod -R 700 /root/backup %preun %postun