Gmorks Wiki
Návody

MySQL

Auto oprava tabulek + optimalizace:

mysqlcheck -u root -p --auto-repair --check --optimize --all-databases

Omezeni logu mysql na velikost 3 dnu a nastaveni kodovani:

# mysql.cnf

[mysqld]
expire_logs_days=3
character-set-server    = utf8
collation_server        = utf8_czech_ci
skip-character-set-client-handshake

[mysql]
default-character-set=utf8

Backup

# SQL backup
00 2 * * * /usr/local/sbin/sqlbackup.sh &> /dev/null

#!/bin/sh
datum=`/bin/date +%Y%m%d-%H`
/usr/bin/mysqldump -u root -ppassword groupoffice >  /home/sqlbackup/groupoffice-${datum}.sql
/usr/bin/mysqldump -u root -ppassword amavis >  /home/sqlbackup/amavis-${datum}.sql
for file in "$( /usr/bin/find /home/sqlbackup -type f -mtime +7 )"
do
  /bin/rm -f $file
done

exit 0