/[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.4 by stephdl, Sun Apr 2 16:57:21 2017 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 8  %define release 13
4  %define rpmver   3.0.RC6  %define rpmver   3.0.RC6
5    
6  epoch: 2  epoch: 2
# Line 19  Requires:              pax Line 19  Requires:              pax
19  Requires: automysqlbackup  Requires: automysqlbackup
20  BuildRequires:      e-smith-devtools  BuildRequires:      e-smith-devtools
21  Patch0: smeserver-automysqlbackup-AdjustableCronJob.patch  Patch0: smeserver-automysqlbackup-AdjustableCronJob.patch
22    Patch1: smeserver-automysqlbackup-enhanced-templates.patch
23    Patch2: smeserver-automysqlbackup-fix-runmysql.patch
24    Patch3: smeserver-automysqlbackup-update-permission-change.patch
25    Patch4: smeserver-automysqlbackup-3.0.RC6-bz10806.errorsAndCreateUsers.patch
26    
27  %description  %description
28  This RPM is an unofficial addon for the SME Server 9.x.    This RPM is an unofficial addon for the SME Server 9.x.  
29  The target audience is the Linux/E-smith administrator  The target audience is the Linux/E-smith administrator
# Line 28  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-13.sme
37    - fix multiple cause of error noise and performance [SME: 10806]
38      * avoid parallel run of all backups, cron template rewritten
39      * avoid multiple parallel or repeated chmod and chown
40      * protect from undesired chmod or chown
41      * consistent use of status for cron and conf templates
42      * create backup user for mysql, mysql55 and mysql57 (Maria to do)
43      * update mysql53 use to mysql51 as variable
44      * migrate fragment to remove Mysql55 Mysql57 Mymaria Mysql53 if Mysql53 exist
45      * remove default value in db for  Mysql55 Mysql57 Mymaria Mysql53
46      * default as enabled in fragments for all automysql My* properties
47    - create default user in dbs [SME: 10808]
48    
49    * Mon Nov 26 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-11.sme
50    - fix runmysqlscript to allow for change in Backupdir key [SME: 10655]
51    
52    * Mon Nov 26 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-10.sme
53    - fix runmysqlbackup to allow for new databases [SME: 10654]
54    
55    * Fri Jul 06 2018 John Crisp <jcrisp@safeandsoundit.co.uk> 3.0.RC6-9.sme
56    - Template configuration files
57    - run automysqlbackup per conf directly from cron rather than runmysqlbackup
58    - Add extra DB keys for mysql53, mysql55, mysql57
59    
60  * Sun Apr 02 2017 stephane de Labrusse <stephdl@de-labrusse.fr> 3.0.RC6-8.sme  * Sun Apr 02 2017 stephane de Labrusse <stephdl@de-labrusse.fr> 3.0.RC6-8.sme
61  - Added smeserver-automysqlbackup-AdjustableCronJob.patch  - Added smeserver-automysqlbackup-AdjustableCronJob.patch
62  - The time to run the Job is adjustable  - The time to run the Job is adjustable
# Line 54  rm -rf $RPM_BUILD_ROOT Line 83  rm -rf $RPM_BUILD_ROOT
83    
84  %setup  %setup
85  %patch0 -p1  %patch0 -p1
86    %patch1 -p1
87    %patch2 -p1
88    %patch3 -p1
89    %patch4 -p1
90    
91  %build  %build
92  perl createlinks  perl createlinks
# Line 77  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  
   
 #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  
113    
114  #protect the backup folder  #protect the backup folder
115  chmod -R 700 /root/backup/db  chmod -R 700 /root/backup/db
# Line 99  if [ $1 = 0 ] ; then Line 120  if [ $1 = 0 ] ; then
120  SMEDB=automysqlbackup  SMEDB=automysqlbackup
121  MYSQLUSER=backupuser  MYSQLUSER=backupuser
122  echo "======================================================================="  echo "======================================================================="
123  echo "  delete mysql user and revoque all permissions"  echo "  "
124    echo "  delete mysql user and revoke all permissions"
125  # This section deletes backupuser  # This section deletes backupuser
126  mysql -u root -e "REVOKE ALL PRIVILEGES ON *.* FROM '$MYSQLUSER'@'localhost';"  mysql -u root -e "REVOKE ALL PRIVILEGES ON *.* FROM '$MYSQLUSER'@'localhost';"
127  mysql -u root -e "DROP USER $MYSQLUSER@localhost;"  mysql -u root -e "DROP USER $MYSQLUSER@localhost;"
128  echo "  "  echo "  "
129    echo "Do that for each DB - e.g mysq55, mysql57 etc"
130    echo "  "
131  # Delete custom template fragment  # Delete custom template fragment
132  echo "  delete db configuration automysqlbackup"  echo "  delete db configuration automysqlbackup"
133    echo "  "
134  echo "======================================================================="  echo "======================================================================="
135    
136  /sbin/e-smith/config delete $SMEDB  /sbin/e-smith/config delete $SMEDB


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