Merge pull request #168 from woogerboy21/servatrice-shellmaint-scripts

DB Maint Scripts
This commit is contained in:
Gavin Bisesi 2014-07-02 17:56:32 -04:00
commit e198f775dc
4 changed files with 10 additions and 0 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@ tags
build*
*.qm
.directory
mysql.cnf

View file

@ -0,0 +1,3 @@
#!/bin/bash
# SCHEDULE WITH CRONTAB BASED ON TIME PERIOD REPLAYS SHOULD BE SAVED UNTIL (EX: SCHEDULE ONCE A WEEK TO KEEP A WEEKS WORTH OF REPLAYS IN THE DB)
mysql --defaults-file=./mysql.cnf -h localhost -e 'truncate table servatrice.cockatrice_replays;truncate table servatrice.cockatrice_replays_access'

View file

@ -0,0 +1,3 @@
#!/bin/bash
# SCHEDULE WITH CRONTAB TO RUN ONCE A MONTH
mysql --defaults-file=./mysql.cnf -h localhost -e "delete from servatrice.cockatrice_sessions where start_time < DATE_SUB(now(), INTERVAL 1 MONTH)"

View file

@ -0,0 +1,3 @@
[client]
user={db_username}
password={db_password}