Cron pour l'optimisation hebdomadaire de la bdd alternc (à merger par Xals)

This commit is contained in:
Alan Garcia 2011-06-04 09:33:47 +00:00
parent ae04e40a50
commit 255f3d3096
4 changed files with 8 additions and 1 deletions

1
.gitattributes vendored
View File

@ -460,6 +460,7 @@ po/fr/LC_MESSAGES/alternc-admintools.po -text
/quota_init -text /quota_init -text
src/Makefile -text src/Makefile -text
src/alternc-check -text src/alternc-check -text
src/alternc-dboptimize -text
src/alternc-passwd -text src/alternc-passwd -text
src/alternc_reload -text src/alternc_reload -text
src/du.pl -text src/du.pl -text

View File

@ -15,3 +15,5 @@
# You may put this computing every week only or on your filer on busy services. # You may put this computing every week only or on your filer on busy services.
0 2 * * * www-data /usr/lib/alternc/spoolsize.php 0 2 * * * www-data /usr/lib/alternc/spoolsize.php
# Once a week at 7am, optimise the AlternC database
0 1 * * 7 alterncpanel /usr/lib/alternc/alternc-dboptimize

View File

@ -26,7 +26,7 @@
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# #
SETUID=mail_add mail_del quota_edit quota_get mem_add mem_del SETUID=mail_add mail_del quota_edit quota_get mem_add mem_del
SCRIPTS=quota_edit.sh quota_get.sh sqlbackup.sh rawstat.daily quota_init quota_delete update_domains.sh slave_dns sendmail spoolsize.php fixperms.sh SCRIPTS=quota_edit.sh quota_get.sh sqlbackup.sh rawstat.daily quota_init quota_delete update_domains.sh slave_dns sendmail spoolsize.php fixperms.sh alternc-check alternc-dboptimize
LIBS=functions.sh functions_hosting.sh functions_dns.sh LIBS=functions.sh functions_hosting.sh functions_dns.sh
BIN=$(DESTDIR)/usr/lib/alternc/ BIN=$(DESTDIR)/usr/lib/alternc/

4
src/alternc-dboptimize Normal file
View File

@ -0,0 +1,4 @@
#!/bin/bash
# Optimize alternc databases
/usr/bin/mysqlcheck --defaults-file=/etc/alternc/my.cnf --quick --force --optimize --auto-repair --databases $(cat /etc/alternc/my.cnf |grep ^database|cut -d '"' -f 2) > /dev/null