Commit 2b551701 authored by woogerboy21's avatar woogerboy21
Browse files

DB Maint Scripts

External shell script to help maintain the cockatrice database tables.
parent fb4a7b32
#!/bin/bash
#RUN THIS SCRIPT TO REMOVE ALL COCKATRICE REPLAYS FROM THE DATABASE
#--CAN BE SCHEDULED WITH CRONTAB
mysql --defaults-file=./mysql.cnf -h localhost -e 'truncate table servatrice.cockatrice_replays'
mysql --defaults-file=./mysql.cnf -h localhost -e 'truncate table servatrice.cockatrice_replays_access'
#!/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}%\""
[client]
user={db_username}
password={db_password}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment