OXIESEC PANEL
- Current Dir:
/
/
home
/
cubot
/
bin
/
utils
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/03/2023 08:06:37 AM
rwxr-xr-x
📄
.auditreport.sh.swp
12 KB
02/03/2023 07:34:08 AM
rw-r--r--
📄
CollectReportData.sh
2.17 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
ComapreCubotTableData.sh
1.06 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
VBox.sh
1.59 KB
02/03/2023 07:34:08 AM
rw-r--r--
📄
auditreport.sh
1.35 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
cleanSRCid.sql
386 bytes
02/03/2023 07:34:08 AM
rw-r--r--
📄
cleancache.sh
8.89 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
compare_database.sh
148 bytes
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
compressCSS.sh
262 bytes
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
compressJS.sh
251 bytes
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
cubbackup.sh
1.43 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
cubbackup_sync.sh
314 bytes
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
cubmonitor.sh
3.77 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
cubotmail
29.64 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
esalesforce.pl
1.87 KB
02/03/2023 07:34:08 AM
rw-r--r--
📄
etl_xform_template.sh
543 bytes
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
killrunaway.sh
609 bytes
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
migrateSharedreports.sh
1.14 KB
02/03/2023 07:34:08 AM
rw-r--r--
📄
mysql2pgsql.perl
40.98 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
removenewlinechar.awk
292 bytes
02/03/2023 07:34:08 AM
rw-r--r--
📄
removenewlinechar.pl
534 bytes
02/03/2023 07:34:08 AM
rw-r--r--
📄
removenewlinechar2.awk
82 bytes
02/03/2023 07:34:08 AM
rw-r--r--
📄
renameCubUser.sh
2.38 KB
02/03/2023 07:34:08 AM
rw-r--r--
📄
sendmail.pl
2.13 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
updatealldb.sh
1.08 KB
02/03/2023 07:34:08 AM
rw-r--r--
📄
yuicompressor-2.4.6.jar
832.85 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
zap
1.86 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
Editing: cleancache.sh
Close
#!/bin/bash if [ "$1" == "" ] then echo "Usage: sh $0 databasename" echo "Exiting as I dont have anything to do..." exit fi export DB=$1 export LD_ASSUME_KERNEL=2.4 # Note this may need to get commented if any glibc error #export MYSQL_UNIX_PORT=/var/lib/mysql/mysql.sock # Need to put proper MYSQL Socket export CUBOT_HOME=/home/cubot/ ########################################## Do Not Change Below This Line ############################################## echo "data_series counts before Cacheverify ... : `date` " mysql -u root -N $DB <<! select count(*) "RUNNING SERIES COUNT " from data_series,ds_stat where ds_series_id = ds_src_id and dt_status='R'\G; select count(1) from data_series; ! #Adhoc Reports mysql $DB << ! drop table if exists tmp_adhoc; #create table tmp_adhoc select gs_series_id id from graph_series where substring(gs_id,1,1) not in ('V', 'F', 'T'); create table tmp_adhoc select gs_series_id id from graph_series where gs_id < 100000; alter table tmp_adhoc modify column id int; create index adhoc_idx on tmp_adhoc(id); ! #Saved Reports mysql $DB << ! drop table if exists tmp_saverpt; #create table tmp_saverpt select gs_series_id id1 from graph_series where substring(gs_id,1,1) in ('V', 'F', 'T'); create table tmp_saverpt select gs_series_id id1 from graph_series where gs_id > 100000; create index save_idx on tmp_saverpt(id1); ! echo "Creating tmp_unused" mysql $DB << ! drop table if exists tmp_unused; create table tmp_unused (select id "cid" from tmp_adhoc where id not in ( select id from tmp_adhoc, tmp_saverpt where id = id1)); alter table tmp_unused modify column cid int; create index cmn_idx on tmp_unused(cid); ! echo "Getting All referenced & non referenced Seriess." mysql $DB << ! #Get All referenced Seriess. drop table if exists tmp_refdsstat; create table tmp_refdsstat(tr_series_id int(10)); insert into tmp_refdsstat select dt_series_id from data_series, ds_stat where dt_series_id = ds_series_id ; create index tmp_refdsstat_idx on tmp_refdsstat(tr_series_id); #Get All non-referenced Seriess From ds_stat. drop table if exists tmp_norefdsstat; create table tmp_norefdsstat select * from ds_stat where dt_series_id not in (select tr_series_id from tmp_refdsstat); create index tmp_norefdsstat_idx on tmp_norefdsstat(dt_series_id); ! #Cache Table Counts mysql $DB << ! select count(*) "TOTAL DATA_SERIES COUNT " from data_series\G select count(*) "TOTAL GRAPH_SERIES COUNT " from graph_series\G select count(*) "TOTAL GRAPH_DEF COUNT " from graph_def\G select count(*) "TOTAL DATA_XY COUNT " from data_xy\G select count(*) "INVALID SERIES COUNT " from data_series where ds_series_id = ds_src_id\G select count(*) "TOTAL DS_STAT COUNT " from ds_stat\G select dt_status "STATUS", count(*) "SERIES IN DS_STAT" from ds_stat group by dt_status; ! #Common Series between Adhoc & Saved Reoprts mysql $DB << ! select count(*) "TOTAL ADHOC REPORTS SERIES " from tmp_adhoc\G select count(*) "TOTAL SAVED REPORTS SERIES " from tmp_saverpt\G select count(*) "COMMON SERIES IN ADHOC&SAVED " from tmp_adhoc, tmp_saverpt where tmp_adhoc.id=tmp_saverpt.id1\G ! #Clearing Unused Series echo "" echo "Running Regen To Clear Series" export Queryout=1 #time /home/cubtest/REGEN_CODE/regen/cubregenxy -d $DB -cf -v time $CUBOT_HOME/bin/cubregenxy -d $DB -cf -v echo "Finished Clearing Series" echo "" #DS_STAT Status mysql $DB << ! select count(*) "TOTAL DS_STAT COUNT " from ds_stat\G select dt_status "STATUS", count(*) "SERIES IN DS_STAT" from ds_stat group by dt_status; ! mysql $DB << ! select count(ds_series_id)+1 "REGEN WILL PROOCESS SERIES " from data_series, ds_stat where ds_series_id > 0 and ds_series_id & 1048576 > 0 and ds_series_id = dt_series_id and dt_status != 'D' order by ds_series_id\G ! echo "" echo "" echo "D-Marking Non-Referenced Series from ds_stat" mysql $DB << ! #Assume series-ids as referenced those are in graph_series. delete from tmp_norefdsstat where tmp_norefdsstat.dt_series_id in (select dt_series_id from graph_series, ds_stat where dt_series_id = gs_series_id) ; #delete unused series from ds_stat update ds_stat set dt_status = 'D' where dt_series_id in(select dt_series_id from tmp_norefdsstat); ! #Running Cache verify echo "Running Cache verify" mysql $DB << ! update ds_stat set dt_status = 'D' where dt_series_id in(select ds_series_id from data_series where ds_series_id = ds_src_id ); delete from data_series where ds_series_id in(select dt_series_id from ds_stat where dt_status = 'D'); delete from data_seriesids where di_seriesid in(select dt_series_id from ds_stat where dt_status = 'D'); delete from data_seriesvals where dv_seriesid in(select dt_series_id from ds_stat where dt_status = 'D'); delete from data_xy where xy_series_id in(select dt_series_id from ds_stat where dt_status = 'D'); delete from ds_stat where dt_status <> 'V'; ! #Adhoc Series echo "Deleting Unused Adhoc Series" mysql $1 << ! delete from graph_series where gs_series_id in (select cid from tmp_unused); delete from data_series where ds_series_id in (select cid from tmp_unused); delete from data_seriesids where di_seriesid in (select cid from tmp_unused); delete from data_seriesvals where dv_seriesid in(select cid from tmp_unused); delete from data_xy where xy_series_id in(select cid from tmp_unused); ! #Adhoc Reports echo "Looking Unused Adhoc Reports" mysql $1 << ! drop table if exists tmp_tmprpt; #create table tmp_tmprpt select gf_id from graph_def where substring(gf_id,1,1) not in ('V', 'F', 'T'); create table tmp_tmprpt select gf_id from graph_def where gf_id < 100000; alter table tmp_tmprpt modify column gf_id int; create index tmp_tmprpt_ix on tmp_tmprpt(gf_id); ! echo "Deleting Unused Adhoc Reports" mysql $1 << ! delete from graph_series where gs_id in (select gf_id from tmp_tmprpt); delete from graph_def where gf_id in (select gf_id from tmp_tmprpt); delete from graph_access where ga_gf_id in (select gf_id from tmp_tmprpt); delete from graph_notes where gn_gid in (select gf_id from tmp_tmprpt); delete from graph_props where gp_id in (select gf_id from tmp_tmprpt); ! echo "data_series counts after Manual Cacheverify ... : `date` " mysql -u root -N $DB <<! select count(1) from data_series; ! #Adhoc Reports mysql $DB << ! drop table if exists tmp_adhoc; #create table tmp_adhoc select gs_series_id id from graph_series where substring(gs_id,1,1) not in ('V', 'F', 'T'); create table tmp_adhoc select gs_series_id id from graph_series where gs_id < 100000; create index adhoc_idx on tmp_adhoc(id); ! #Unused data_xy mysql $DB << ! drop table if exists tmp_ds; create table tmp_ds select distinct dt_series_id from ds_stat; alter table tmp_ds modify column dt_series_id int; create index tmp_ds_idx on tmp_ds(dt_series_id); drop table if exists tmp_dxy; create table tmp_dxy select distinct xy_series_id from data_xy; alter table tmp_dxy modify column xy_series_id int; create index tmp_dxy_idx on tmp_dxy(xy_series_id); drop table if exists tmp_ds_xy; create table tmp_ds_xy select distinct xy_series_id from tmp_dxy where xy_series_id not in (select xy_series_id from tmp_ds, tmp_dxy where dt_series_id=xy_series_id); alter table tmp_ds_xy modify column xy_series_id int; create index tmp_ds_xy_idx on tmp_ds_xy(xy_series_id); delete from data_xy where xy_series_id in (select xy_series_id from tmp_ds_xy); ! #Saved Reports mysql $DB << ! drop table if exists tmp_saverpt; #create table tmp_saverpt select gs_series_id id1 from graph_series where substring(gs_id,1,1) in ('V', 'F', 'T'); create table tmp_saverpt select gs_series_id id1 from graph_series where gs_id > 100000; create index save_idx on tmp_saverpt(id1); ! mysql $DB << ! drop table if exists tmp_unused; create table tmp_unused (select id "cid" from tmp_adhoc where id not in ( select id from tmp_adhoc, tmp_saverpt where id = id1)); alter table tmp_unused modify column cid int; create index cmn_idx on tmp_unused(cid); ! #Cache Table Counts mysql $DB << ! select count(*) "TOTAL DATA_SERIES COUNT " from data_series\G select count(*) "TOTAL GRAPH_SERIES COUNT " from graph_series\G select count(*) "TOTAL GRAPH_DEF COUNT " from graph_def\G select count(*) "TOTAL DATA_XY COUNT " from data_xy\G select count(*) "TOTAL DS_STAT COUNT " from ds_stat\G select dt_status "STATUS", count(*) "SERIES IN DS_STAT" from ds_stat group by dt_status; ! #Common Series between Adhoc & Saved Reoprts mysql $DB << ! select count(*) "TOTAL ADHOC REPORTS SERIES " from tmp_adhoc\G select count(*) "TOTAL SAVED REPORTS SERIES " from tmp_saverpt\G select count(*) "COMMON SERIES IN ADHOC&SAVED " from tmp_adhoc, tmp_saverpt where tmp_adhoc.id=tmp_saverpt.id1\G ! mysql $DB << ! select count(ds_series_id)+1 "REGEN WILL PROOCESS SERIES " from data_series, ds_stat where ds_series_id > 0 and ds_series_id & 1048576 > 0 and ds_series_id = dt_series_id and dt_status != 'D' order by ds_series_id\G ! echo "" echo "data_series counts after Cacheverify ... : `date` " mysql -u root -N $DB <<! select count(1) from data_series; ! echo "Series sequence value on ... : `date` " mysql -u root -N $DB <<! select ss_seq from series_seq; !