Update DB Scripts

Added backup / restore scripts.
Added table size script
Updated existing scripts to use variable location for mysql.cnf file
This commit is contained in:
woogerboy21 2015-07-11 11:22:54 -04:00
parent f733daf18a
commit 04c09647d7
8 changed files with 105 additions and 4 deletions

View file

@ -1,3 +1,4 @@
#!/bin/bash
# SCHEDULE WITH CRONTAB BASED ON TIME PERIOD UNACTIVE ACCOUNT SHOULD BE REMOVED. UPDATE INTERVAL DATE TO BE NUMBER OF DAYS OLD (OR OLDER) TO REMOVE.
mysql --defaults-file=./mysql.cnf -h localhost -e 'delete from servatrice.cockatrice_users where registrationDate < DATE_SUB(now(), INTERVAL 5 DAY) AND active = 0';
SQLCONFFILE="./mysql.cnf" #set this to the path that contains the mysql.cnf file
mysql --defaults-file=$SQLCONFFILE -h localhost -e 'delete from servatrice.cockatrice_users where registrationDate < DATE_SUB(now(), INTERVAL 5 DAY) AND active = 0';