From 255f3d30964f41ba39e88b9fa20b24b1010fa3c6 Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Sat, 4 Jun 2011 09:33:47 +0000 Subject: [PATCH] =?UTF-8?q?Cron=20pour=20l'optimisation=20hebdomadaire=20d?= =?UTF-8?q?e=20la=20bdd=20alternc=20(=C3=A0=20merger=20par=20Xals)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 1 + debian/alternc.cron.d | 2 ++ src/Makefile | 2 +- src/alternc-dboptimize | 4 ++++ 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 src/alternc-dboptimize diff --git a/.gitattributes b/.gitattributes index 8756d420..591b5d0b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -460,6 +460,7 @@ po/fr/LC_MESSAGES/alternc-admintools.po -text /quota_init -text src/Makefile -text src/alternc-check -text +src/alternc-dboptimize -text src/alternc-passwd -text src/alternc_reload -text src/du.pl -text diff --git a/debian/alternc.cron.d b/debian/alternc.cron.d index 7633be7d..7cd02c68 100644 --- a/debian/alternc.cron.d +++ b/debian/alternc.cron.d @@ -15,3 +15,5 @@ # You may put this computing every week only or on your filer on busy services. 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 diff --git a/src/Makefile b/src/Makefile index e0fde013..62247232 100644 --- a/src/Makefile +++ b/src/Makefile @@ -26,7 +26,7 @@ # ---------------------------------------------------------------------- # 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 BIN=$(DESTDIR)/usr/lib/alternc/ diff --git a/src/alternc-dboptimize b/src/alternc-dboptimize new file mode 100644 index 00000000..e53858f7 --- /dev/null +++ b/src/alternc-dboptimize @@ -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