/[smecontribs]/rpms/smeserver-automysqlbackup/contribs9/smeserver-automysqlbackup.spec
ViewVC logotype

Diff of /rpms/smeserver-automysqlbackup/contribs9/smeserver-automysqlbackup.spec

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.8 by jpp, Tue Nov 26 03:40:46 2019 UTC Revision 1.9 by jpp, Tue Nov 26 17:18:49 2019 UTC
# Line 1  Line 1 
1  %define name smeserver-automysqlbackup  %define name smeserver-automysqlbackup
2  %define version 3.0.RC6  %define version 3.0.RC6
3  %define release 12  %define release 13
4  %define rpmver   3.0.RC6  %define rpmver   3.0.RC6
5    
6  epoch: 2  epoch: 2
# Line 33  This script is based on automysqlbackup Line 33  This script is based on automysqlbackup
33    
34    
35  %changelog  %changelog
36  * Sun Sep 22 2019 Jean-Philipe Pialasse <tests@pialasse.com> 3.0.RC6-12.sme  * Sun Sep 22 2019 Jean-Philipe Pialasse <tests@pialasse.com> 3.0.RC6-13.sme
37  - fix multiple cause of error noise and performance [SME: 10806]  - fix multiple cause of error noise and performance [SME: 10806]
38    * avoid parallel run of all backups, cron template rewritten    * avoid parallel run of all backups, cron template rewritten
39    * avoid multiple parallel or repeated chmod and chown    * avoid multiple parallel or repeated chmod and chown
# Line 110  rm -rf $RPM_BUILD_ROOT Line 110  rm -rf $RPM_BUILD_ROOT
110  %pre  %pre
111    
112  %post  %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 "***********************************************************************"  
113    
114  #protect the backup folder  #protect the backup folder
115  chmod -R 700 /root/backup/db  chmod -R 700 /root/backup/db


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed