Merge pull request #168 from woogerboy21/servatrice-shellmaint-scripts
DB Maint Scripts
This commit is contained in:
commit
e198f775dc
4 changed files with 10 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@ tags
|
|||
build*
|
||||
*.qm
|
||||
.directory
|
||||
mysql.cnf
|
||||
|
|
3
servatrice/scripts/maint_replays
Normal file
3
servatrice/scripts/maint_replays
Normal 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'
|
3
servatrice/scripts/maint_sessions
Normal file
3
servatrice/scripts/maint_sessions
Normal 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)"
|
3
servatrice/scripts/mysql.cnf.example
Normal file
3
servatrice/scripts/mysql.cnf.example
Normal file
|
@ -0,0 +1,3 @@
|
|||
[client]
|
||||
user={db_username}
|
||||
password={db_password}
|
Loading…
Reference in a new issue