Merge pull request #1259 from woogerboy21/update_servatrice_scripts
Script Cleanup
This commit is contained in:
commit
51d12f3ed6
14 changed files with 51 additions and 23 deletions
|
@ -1,3 +0,0 @@
|
|||
#!/bin/bash
|
||||
SQLCONFFILE="./mysql.cnf" #set this to the path that contains the mysql.cnf file
|
||||
mysql --defaults-file=$SQLCONFFILE -e 'SELECT table_name AS "Tables", round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" FROM information_schema.TABLES WHERE table_schema = "servatrice" ORDER BY (data_length + index_length) DESC;'
|
8
servatrice/scripts/linux/info_db_tablesize
Normal file
8
servatrice/scripts/linux/info_db_tablesize
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
#USE THIS SCRIPT TO IDENTIFY THE SIZE OF YOUR TABLES IN THE DATABASE
|
||||
|
||||
DBNAME="servatrice" #set this to the database name used
|
||||
TABLEPREFIX="cockatrice" #set this to the prefix used for the table names in the database (do not inclue the _)
|
||||
SQLCONFFILE="./mysql.cnf" #set this to the path that contains the mysql.cnf file
|
||||
mysql --defaults-file=$SQLCONFFILE -e 'SELECT table_name AS "Tables", round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" FROM information_schema.TABLES WHERE table_schema = "'$DBNAME'" ORDER BY (data_length + index_length) DESC;'
|
9
servatrice/scripts/linux/maint_inactiveaccounts
Normal file
9
servatrice/scripts/linux/maint_inactiveaccounts
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
# SCHEDULE WITH CRONTAB ON A REGULAR BASIS. NUMBER OF DAYS IS THE AMOUNT OF DAYS TO KEEP INACTIVE ACCOUNTS (EX: 1 DAY REMOVES ALL INACTIVE ACCOUNTS OLDER THAN A SINGLE DAY).
|
||||
|
||||
DBNAME="servatrice" #set this to the database name used
|
||||
TABLEPREFIX="cockatrice" #set this to the prefix used for the table names with in the database
|
||||
SQLCONFFILE="./mysql.cnf" #set this to the path that contains the mysql.cnf file
|
||||
NUMBEROFDAYS=5 #set this to the number of days to search for
|
||||
mysql --defaults-file=$SQLCONFFILE -h localhost -e "delete from ""$DBNAME"".""$TABLEPREFIX""_users where active = 0 AND registrationDate < DATE_SUB(now(), INTERVAL ""$NUMBEROFDAYS"" DAY);"
|
9
servatrice/scripts/linux/maint_logs
Normal file
9
servatrice/scripts/linux/maint_logs
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
#SCHEDULE WITH CRONTAB AND ADJUST THE INTERVALS FOR THE NUMBER OF DAYS OF LOGS TO KEEP IN THE DATABASE
|
||||
|
||||
DBNAME="servatrice" #set this to the database name used
|
||||
TABLEPREFIX="cockatrice" #set this to the prefix used for the table names in the database (do not inclue the _)
|
||||
SQLCONFFILE="./mysql.cnf" #set this to the path that contains the mysql.cnf file
|
||||
NUMBEROFDAYS=10 #set this to the number of days desired
|
||||
mysql --defaults-file=$SQLCONFFILE -h localhost -e 'delete from ""$DBNAME"".""$TABLEPREFIX""_log where log_time < DATE_SUB(now(), INTERVAL ""$NUMBEROFDAYS"" DAY)'
|
8
servatrice/scripts/linux/maint_replays
Normal file
8
servatrice/scripts/linux/maint_replays
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/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)
|
||||
|
||||
DBNAME="servatrice" #set this to the database name used
|
||||
TABLEPREFIX="cockatrice" #set this to the prefix used for the table names in the database (do not inclue the _)
|
||||
SQLCONFFILE="./mysql.cnf" #set this to the path that contains the mysql.cnf file
|
||||
mysql --defaults-file=$SQLCONFFILE -h localhost -e 'truncate table ""$DBNAME"".""$TABLEPREFIX""_replays;truncate table ""$DBNAME"".""$TABLEPREFIX""_replays_access'
|
9
servatrice/scripts/linux/maint_sessions
Normal file
9
servatrice/scripts/linux/maint_sessions
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
# SCHEDULE WITH CRONTAB TO RUN ON A REGULAR BASIS
|
||||
|
||||
DBNAME="servatrice" #set this to the database name used
|
||||
TABLEPREFIX="cockatrice" #set this to the prefix used for the table names in the database (do not inclue the _)
|
||||
SQLCONFFILE="./mysql.cnf" #set this to the path that contains the mysql.cnf file
|
||||
NUMBEROFDAYS=10 #set this to the number of days desired
|
||||
mysql --defaults-file=$SQLCONFFILE -h localhost -e "delete from ""$DBNAME"".""$TABLEPREFIX""_sessions where start_time < DATE_SUB(now(), INTERVAL ""$NUMBEROFDAYS"" DAY)"
|
8
servatrice/scripts/linux/setup_addfirstadmin
Normal file
8
servatrice/scripts/linux/setup_addfirstadmin
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
# SCRIPT TO ADD THE FIRST ADMIN USER NAMED SERVATRICE WITH THE PASSWORD OF PASSWORD
|
||||
|
||||
DBNAME="servatrice" #set this to the database name used
|
||||
TABLEPREFIX="cockatrice" #set this to the prefix used for the table names in the database (do not inclue the _)
|
||||
SQLCONFFILE="./mysql.cnf" #set this to the path that contains the mysql.cnf file
|
||||
mysql --defaults-file=$SQLCONFFILE -h localhost -e "insert into ""$DBNAME"".""$TABLEPREFIX""_users (admin,name,password_sha512,active) values (1,'servatrice','jbB4kSWDmjaVzMNdU13n73SpdBCJTCJ/JYm5ZBZvfxlzbISbXir+e/aSvMz86KzOoaBfidxO0s6GVd8t00qC0TNPl+udHfECaF7MsA==',1);"
|
|
@ -1,4 +0,0 @@
|
|||
#!/bin/bash
|
||||
#SCHEDULE WITH CRONTAB AND ADJUST THE INTERVALS FOR THE NUMBER OF DAYS OF LOGS TO KEEP IN THE DATABASE
|
||||
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_log where log_time < DATE_SUB(now(), INTERVAL 10 DAY)'
|
|
@ -1,4 +0,0 @@
|
|||
#!/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.
|
||||
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';
|
|
@ -1,4 +0,0 @@
|
|||
#!/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)
|
||||
SQLCONFFILE="./mysql.cnf" #set this to the path that contains the mysql.cnf file
|
||||
mysql --defaults-file=$SQLCONFFILE -h localhost -e 'truncate table servatrice.cockatrice_replays;truncate table servatrice.cockatrice_replays_access'
|
|
@ -1,4 +0,0 @@
|
|||
#!/bin/bash
|
||||
# SCHEDULE WITH CRONTAB TO RUN ONCE A MONTH
|
||||
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_sessions where start_time < DATE_SUB(now(), INTERVAL 1 MONTH)"
|
|
@ -1,4 +0,0 @@
|
|||
#!/bin/bash
|
||||
# SCRIPT TO ADD THE FIRST ADMIN USER NAMED SERVATRICE WITH THE PASSWORD OF PASSWORD
|
||||
SQLCONFFILE="./mysql.cnf" #set this to the path that contains the mysql.cnf file
|
||||
mysql --defaults-file=$SQLCONFFILE -h localhost -e "insert into servatrice.cockatrice_users (admin,name,password_sha512,active) values (1,'servatrice','jbB4kSWDmjaVzMNdU13n73SpdBCJTCJ/JYm5ZBZvfxlzbISbXir+e/aSvMz86KzOoaBfidxO0s6GVd8t00qC0TNPl+udHfECaF7MsA==',1);"
|
Loading…
Reference in a new issue