mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 11:38:49 -07:00
DB Maint Scripts
External shell script to help maintain the cockatrice database tables.
This commit is contained in:
parent
fb4a7b3274
commit
2b55170110
3 changed files with 16 additions and 0 deletions
7
servatrice/scripts/maint_sessions
Normal file
7
servatrice/scripts/maint_sessions
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
#REPLACE THE --date="1 month ago" WITH THE TIME FRAME TO CLEAR UP
|
||||
#EX: --date="1 day ago" (FOR SINGLE DAY)
|
||||
#--CAN BE SCHEDULED WITH CRONTAB
|
||||
|
||||
DATE=$(date +%Y-%m --date="1 month ago")
|
||||
mysql --defaults-file=./mysql.cnf -h localhost -e "delete from servatrice.cockatrice_sessions where start_time like \"${DATE}%\""
|
||||
Loading…
Add table
Add a link
Reference in a new issue