添加后台代理代码和数据库
This commit is contained in:
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@
|
||||
|
||||
// 通过域名判断环境
|
||||
$.API_URL = 'https://dlapi.daoqijuyou77.cn/Index.php';
|
||||
$.RETURN_URL = 'https://dlweb.daoqijuyou77.cn/web2/notify.html';
|
||||
$.RETURN_URL = 'https://dlapi.daoqijuyou77.cn/web2/notify.html';
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
|
||||
$.API_URL = 'https://dlapi.daoqijuyou77.cn/Index.php';
|
||||
$.RETURN_URL = 'https://dlweb.daoqijuyou77.cn/web2/notify.html';
|
||||
$.RETURN_URL = 'https://dlapi.daoqijuyou77.cn/web2/notify.html';
|
||||
$.SETTLE_URL = 'http://dlsettle.daoqijuyou77.cn/mobile/';
|
||||
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
|
||||
<div class="list-group">
|
||||
|
||||
<a href="https://dlweb.daoqijuyou77.cn/web2/agent_list.html?agentid=all&show=1" class="list-group-item">用户后台</a>
|
||||
<a href="https://dlweb.daoqijuyou77.cn/web2/agent_list_admin.html?agentid=all" class="list-group-item">
|
||||
<a href="https://dlapi.daoqijuyou77.cn/web2/agent_list.html?agentid=all&show=1" class="list-group-item">用户后台</a>
|
||||
<a href="https://dlapi.daoqijuyou77.cn/web2/agent_list_admin.html?agentid=all" class="list-group-item">
|
||||
结算后台__电脑端(全国)
|
||||
</a>
|
||||
<!-- ts已修改2021 -->
|
||||
|
||||
BIN
codes/agent/tools/bak.zip
Normal file
BIN
codes/agent/tools/bak.zip
Normal file
Binary file not shown.
@@ -1,250 +0,0 @@
|
||||
echo off
|
||||
echo %date% %time%
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::: 同步战绩数据
|
||||
:sync_recorddata
|
||||
|
||||
:init
|
||||
::: mysql导出工具文件全名
|
||||
set ExportBinary="C:\webroot\dbbackup\mysql\mysqldump.exe"
|
||||
::: mysql导入工具文件全名
|
||||
set ImportBinary="C:\webroot\dbbackup\mysql\mysql.exe"
|
||||
|
||||
|
||||
::: 游戏基础信息服务器配置
|
||||
set Hostname_base="rm-bp16sbf0l9cavp7h9o.mysql.rds.aliyuncs.com"
|
||||
set Hostport_base="3306"
|
||||
set Username_base="develop"
|
||||
set Password_base="develop123!@#"
|
||||
set Database_base="youle_games"
|
||||
set ExportTable_base=player
|
||||
|
||||
::: 游戏战绩服务器配置
|
||||
set Hostname_record="rm-bp16sbf0l9cavp7h9o.mysql.rds.aliyuncs.com"
|
||||
set Hostport_record="3306"
|
||||
set Username_record="develop"
|
||||
set Password_record="develop123!@#"
|
||||
set Database_record="youle_games"
|
||||
set ExportTable_record=player_grade,gold_account
|
||||
|
||||
::: 后台服务器配置
|
||||
set Hostname_owner="localhost"
|
||||
set Hostport_owner="3309"
|
||||
set Username_owner="root"
|
||||
set Password_owner="root_root"
|
||||
set Database_owner="game_db"
|
||||
set Database_owner_temp="game_db_temp"
|
||||
|
||||
::: 临时服务器配置
|
||||
set Hostname_temp="localhost"
|
||||
set Hostport_temp="3309"
|
||||
set Username_temp="root"
|
||||
set Password_temp="root_root"
|
||||
set Database_temp="game_db"
|
||||
set Database_temp_temp="game_db_temp"
|
||||
|
||||
::: 是否需要保存到临时库
|
||||
set NeedSaveToTemp=0
|
||||
|
||||
::: 要执行的脚本
|
||||
set ExecuteCommand_1="call cp_SynchronizeSettle();"
|
||||
|
||||
::: 保证脚本输出目录一定存在
|
||||
if not exist "%~dp0script" md "%~dp0script"
|
||||
|
||||
::: 要导出的脚本文件名的前缀(后面还会加上表名)
|
||||
set ScriptnamePrefix=%~dp0script\%date:~0,4%%date:~5,2%%date:~8,2%
|
||||
|
||||
::: 判断脚本是否存在, 存在则删除
|
||||
::if exist %Scriptname% del %Scriptname%
|
||||
|
||||
:export
|
||||
echo 开始导出游戏基础信息脚本
|
||||
for %%t in (%ExportTable_base%) do (
|
||||
::: 判断脚本是否存在, 存在则删除
|
||||
if exist "%ScriptnamePrefix%_base_%%t.sql" del "%ScriptnamePrefix%_base_%%t.sql"
|
||||
|
||||
::: 循环导出脚本
|
||||
echo 导出表%%t到%ScriptnamePrefix%_base_%%t.sql
|
||||
%ExportBinary% --default-character-set=utf8 --opt -h%Hostname_base% -P%Hostport_base% -u%Username_base% -p%Password_base% %Database_base% %%t > "%ScriptnamePrefix%_base_%%t.sql"
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
)
|
||||
echo 游戏基础信息脚本导出完成
|
||||
|
||||
echo 开始导出游戏战绩脚本
|
||||
for %%t in (%ExportTable_record%) do (
|
||||
::: 判断脚本是否存在, 存在则删除
|
||||
if exist "%ScriptnamePrefix%_record_%%t.sql" del "%ScriptnamePrefix%_record_%%t.sql"
|
||||
|
||||
::: 循环导出脚本
|
||||
echo 导出表%%t到%ScriptnamePrefix%_record_%%t.sql
|
||||
%ExportBinary% --default-character-set=utf8 --opt -h%Hostname_record% -P%Hostport_record% -u%Username_record% -p%Password_record% %Database_record% %%t > "%ScriptnamePrefix%_record_%%t.sql"
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
)
|
||||
echo 游戏战绩脚本导出完成
|
||||
|
||||
:import
|
||||
echo 开始导入游戏基础信息脚本
|
||||
for %%t in (%ExportTable_base%) do (
|
||||
echo 从%ScriptnamePrefix%_base_%%t.sql导入表%%t
|
||||
%ImportBinary% --default-character-set=utf8 -h%Hostname_owner% -P%Hostport_owner% -u%Username_owner% -p%Password_owner% %Database_owner_temp% < "%ScriptnamePrefix%_base_%%t.sql"
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
)
|
||||
echo 游戏基础信息脚本导入完成
|
||||
|
||||
echo 开始导入游戏战绩脚本
|
||||
for %%t in (%ExportTable_record%) do (
|
||||
echo 从%ScriptnamePrefix%_record_%%t.sql导入表%%t
|
||||
%ImportBinary% --default-character-set=utf8 -h%Hostname_owner% -P%Hostport_owner% -u%Username_owner% -p%Password_owner% %Database_owner_temp% < "%ScriptnamePrefix%_record_%%t.sql"
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
)
|
||||
echo 游戏战绩脚本导入完成
|
||||
|
||||
:synchronize
|
||||
echo 执行脚本%ExecuteCommand_1%
|
||||
%ImportBinary% -h%Hostname_owner% -P%Hostport_owner% -u%Username_owner% -p%Password_owner% -e%ExecuteCommand_1% %Database_owner%
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
echo 脚本执行完成
|
||||
|
||||
if %NeedSaveToTemp% equ 0 goto convertdata
|
||||
|
||||
:savetotemp
|
||||
echo 开始导入游戏基础信息脚本到临时库
|
||||
for %%t in (%ExportTable_base%) do (
|
||||
echo 从%ScriptnamePrefix%_base_%%t.sql导入表%%t
|
||||
%ImportBinary% --default-character-set=utf8 -h%Hostname_temp% -P%Hostport_temp% -u%Username_temp% -p%Password_temp% %Database_temp_temp% < "%ScriptnamePrefix%_base_%%t.sql"
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
)
|
||||
echo 游戏基础信息脚本导入完成
|
||||
|
||||
echo 开始导入游戏战绩脚本到临时库
|
||||
for %%t in (%ExportTable_record%) do (
|
||||
echo 从%ScriptnamePrefix%_record_%%t.sql导入表%%t
|
||||
%ImportBinary% --default-character-set=utf8 -h%Hostname_temp% -P%Hostport_temp% -u%Username_temp% -p%Password_temp% %Database_temp_temp% < "%ScriptnamePrefix%_record_%%t.sql"
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
)
|
||||
echo 游戏战绩脚本导入完成
|
||||
|
||||
|
||||
echo 执行同步脚本
|
||||
echo 执行脚本%ExecuteCommand_1%
|
||||
%ImportBinary% -h%Hostname_temp% -P%Hostport_temp% -u%Username_temp% -p%Password_temp% -e%ExecuteCommand_1% %Database_temp%
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
echo 脚本执行完成
|
||||
|
||||
:convertdata
|
||||
::"%~dp0MySqlSynchronize.exe"
|
||||
|
||||
:clean
|
||||
echo 删除脚本文件
|
||||
for %%t in (%ExportTable_base%) do del "%ScriptnamePrefix%_base_%%t.sql"
|
||||
for %%t in (%ExportTable_record%) do del "%ScriptnamePrefix%_record_%%t.sql"
|
||||
echo 脚本删除完成
|
||||
|
||||
:sync_recorddata
|
||||
echo %date% %time%
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::: 同步报表
|
||||
:sync_reportdata
|
||||
echo 开始同步报表数据(https://proxytest.tscce.cn/api/ext/SynchronizeReportData.php)
|
||||
"%~dp0HttpRequest.x64.exe" -type post -address "https://proxytest.tscce.cn/api/ext/SynchronizeReportData.php" -parameter "" -interval 1000 -thread 1 -loop 0
|
||||
echo 开始生成报表数据(https://proxytest.tscce.cn/api/ext/autotask.php)
|
||||
"%~dp0HttpRequest.x64.exe" -type post -address "https://proxytest.tscce.cn/api/ext/autotask.php" -parameter "" -interval 1000 -thread 1 -loop 0
|
||||
goto exit
|
||||
|
||||
:exit_reportdata
|
||||
echo %date% %time%
|
||||
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::: 备份数据库
|
||||
:backup_database
|
||||
for /f "tokens=1-3 delims=/-, " %%a in ('echo/%date%') do (
|
||||
set yy=%%a & set mm=%%b & set dd=%%c
|
||||
)
|
||||
set /a dd=100%dd%%%100,mm=100%mm%%%100
|
||||
set /a z=14-mm,z/=12,y=yy+4800-z,m=mm+12*z-3,j=153*m+2
|
||||
set /a j=j/5+dd+y*365+y/4-y/100+y/400-2472633
|
||||
|
||||
set /a j=j-7
|
||||
|
||||
set /a i=j,a=i+2472632,b=4*a+3,b/=146097,c=-b*146097,c/=4,c+=a
|
||||
set /a d=4*c+3,d/=1461,e=-1461*d,e/=4,e+=c,m=5*e+2,m/=153,dd=153*m+2,dd/=5
|
||||
set /a dd=-dd+e+1,mm=-m/10,mm*=12,mm+=m+3,yy=b*100+d-4800+m/10
|
||||
(if %mm% LSS 10 set mm=0%mm%)&(if %dd% LSS 10 set dd=0%dd%)
|
||||
|
||||
set fdate=%yy%-%mm%-%dd%
|
||||
echo %fdate%
|
||||
|
||||
set mysqldump=C:\xampp\mysql\bin\mysqldump.exe
|
||||
set mysql=C:\xampp\mysql\bin\mysql.exe
|
||||
set winrar=C:\Program Files\WinRAR\rar.exe
|
||||
set needupload=0
|
||||
|
||||
::: 开始备份oracle(dbcenter)
|
||||
if exist "%~dp0dbcenter_%yy%%mm%%dd%.dmp" del "%~dp0dbcenter_%yy%%mm%%dd%.dmp"
|
||||
if exist "%~dp0dbcenter_%yy%%mm%%dd%.log" del "%~dp0dbcenter_%yy%%mm%%dd%.log"
|
||||
|
||||
set NLS_LANG=AMERICAN_AMERICA.AL32UTF8
|
||||
set ORACLE_HOME=D:\app\kingsoft\virtual\product\12.2.0\dbhome_1
|
||||
exp '"/ as sysdba"' file="%~dp0dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.dmp" log="%~dp0dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.log" grants=y full=y statistics=none
|
||||
::: 备份oracle(dbcenter)结束
|
||||
|
||||
::: 开始备份mysql(tswldb)
|
||||
if exist "%~dp0tswldb_%yy%%mm%%dd%.sql" del "%~dp0tswldb_%yy%%mm%%dd%.sql"
|
||||
"%mysqldump%" --opt -hlocalhost -P3309 -uroot -proot_root -R tswldb > "%~dp0tswldb_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::: 备份mysql(tswldb)结束
|
||||
|
||||
::: 开始备份mysql(syhd)
|
||||
if exist "%~dp0syhd_%yy%%mm%%dd%.sql" del "%~dp0syhd_%yy%%mm%%dd%.sql"
|
||||
"%mysqldump%" --opt -hlocalhost -P3309 -uroot -proot@admin -R syhd > "%~dp0syhd_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::: 备份mysql(syhd)结束
|
||||
|
||||
::: 开始备份mysql(game_db)
|
||||
if exist "%~dp0game_db_localhost_%yy%%mm%%dd%.sql" del "%~dp0game_db_localhost_%yy%%mm%%dd%.sql"
|
||||
"%mysql%" -h"localhost" -P"3309" -uroot -proot_root -e"truncate table player_grade" game_db
|
||||
"%mysqldump%" --opt -h"localhost" -P"3309" -uroot -proot_root -R game_db > "%~dp0game_db_localhost_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::: 备份mysql(game_db)结束
|
||||
|
||||
|
||||
::: 开始备份mysql(youlehudong)
|
||||
if exist "%~dp0youlehudong_%yy%%mm%%dd%.sql" del "%~dp0youlehudong_%yy%%mm%%dd%.sql"
|
||||
"%mysqldump%" --opt -h"rm-wz978o3vha6z26m5no.mysql.rds.aliyuncs.com" -P"3306" -u"yunuser" -p"Yun_User" -R youlehudong > "%~dp0youlehudong_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::: 备份mysql(youlehudong)结束
|
||||
|
||||
::: 开始备份mysql(game_db)
|
||||
"%mysql%" -h"rm-wz978o3vha6z26m5no.mysql.rds.aliyuncs.com" -P"3306" -u"yunuser" -p"Yun_User" -e"truncate table player_grade" game_db
|
||||
"%mysql%" -h"rm-wz978o3vha6z26m5no.mysql.rds.aliyuncs.com" -P"3306" -u"yunuser" -p"Yun_User" -e"truncate table coin_rebate" game_db
|
||||
if exist "%~dp0game_db_%yy%%mm%%dd%.sql" del "%~dp0game_db_%yy%%mm%%dd%.sql"
|
||||
"%mysqldump%" --opt -h"rm-wz978o3vha6z26m5no.mysql.rds.aliyuncs.com" -P"3306" -u"yunuser" -p"Yun_User" -R game_db > "%~dp0game_db_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::: 备份mysql(game_db)结束
|
||||
|
||||
|
||||
::: 压缩备份文件
|
||||
%~d0
|
||||
cd "%~dp0"
|
||||
if exist "%~dp0database_%yy%%mm%%dd%.rar" del "%~dp0database_%yy%%mm%%dd%.rar"
|
||||
"%winrar%" a "database_%date:~0,4%%date:~5,2%%date:~8,2%.rar" "dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.dmp" "dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.log" "tswldb_%date:~0,4%%date:~5,2%%date:~8,2%.sql" "syhd_%date:~0,4%%date:~5,2%%date:~8,2%.sql" "game_db_localhost_%date:~0,4%%date:~5,2%%date:~8,2%.sql" "youlehudong_%date:~0,4%%date:~5,2%%date:~8,2%.sql" "game_db_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if %needupload% NEQ 0 (
|
||||
::: 上传压缩文件
|
||||
"%~dp0NetworkTool.x64.exe" -st "2" -rt "2" -hn "120.76.157.63" -hp "80" -on "/dbbackup/upload.php" -rd "/" -rf "database_%date:~0,4%%date:~5,2%%date:~8,2%.rar" -lf "%~dp0database_%date:~0,4%%date:~5,2%%date:~8,2%.rar"
|
||||
::: 删除压缩文件
|
||||
:::del "database_%date:~0,4%%date:~5,2%%date:~8,2%.rar"
|
||||
)
|
||||
|
||||
::: 删除备份的文件
|
||||
if exist "%~dp0dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.dmp" del "%~dp0dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.dmp"
|
||||
if exist "%~dp0dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.log" del "%~dp0dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.log"
|
||||
if exist "%~dp0tswldb_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0tswldb_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if exist "%~dp0syhd_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0syhd_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if exist "%~dp0game_db_localhost_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0game_db_localhost_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if exist "%~dp0youlehudong_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0youlehudong_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if exist "%~dp0game_db_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0game_db_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
|
||||
::: 备份完毕
|
||||
:exit
|
||||
|
||||
echo on
|
||||
pause
|
||||
@@ -1,301 +0,0 @@
|
||||
echo off
|
||||
echo %date% %time%
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::: 同步战绩数据
|
||||
:sync_recorddata
|
||||
|
||||
:init
|
||||
::: 停止同步服务
|
||||
::"%~dp0CallerService.exe" -stop
|
||||
net stop CallerService
|
||||
|
||||
::: mysql导出工具文件全名
|
||||
set ExportBinary="C:\webroot\dbbackup\mysql\mysqldump.exe"
|
||||
::: mysql导入工具文件全名
|
||||
set ImportBinary="C:\webroot\dbbackup\mysql\mysql.exe"
|
||||
|
||||
|
||||
::: 游戏基础信息服务器配置
|
||||
set Hostname_base="rm-bp1x3i28se22s9z75o.mysql.rds.aliyuncs.com"
|
||||
set Hostport_base="3306"
|
||||
set Username_base="games"
|
||||
set Password_base="Games2017@)!&"
|
||||
set Database_base="game_db"
|
||||
set ExportTable_base=player
|
||||
|
||||
::: 游戏战绩服务器配置
|
||||
set Hostname_record="rr-bp1x2415jy37d8mu1o.mysql.rds.aliyuncs.com"
|
||||
set Hostport_record="3306"
|
||||
set Username_record="games"
|
||||
set Password_record="Games2017@)!%&"
|
||||
set Database_record="game_db"
|
||||
set ExportTable_record=player_grade,gold_account
|
||||
|
||||
::: 后台服务器配置
|
||||
set Hostname_owner="rm-wz978o3vha6z26m5no.mysql.rds.aliyuncs.com"
|
||||
set Hostport_owner="3306"
|
||||
set Username_owner="yunuser"
|
||||
set Password_owner="Yun_User"
|
||||
set Database_owner="game_db"
|
||||
set Database_owner_temp="game_db_temp"
|
||||
|
||||
::: 临时服务器配置
|
||||
set Hostname_temp="localhost"
|
||||
set Hostport_temp="3309"
|
||||
set Username_temp="root"
|
||||
set Password_temp="root_root"
|
||||
set Database_temp="game_db"
|
||||
set Database_temp_temp="game_db_temp"
|
||||
|
||||
::: 是否需要保存到临时库
|
||||
set NeedSaveToTemp=0
|
||||
|
||||
::: 要执行的脚本
|
||||
set ExecuteCommand_1="call cp_SynchronizeSettle();"
|
||||
|
||||
::: 保证脚本输出目录一定存在
|
||||
if not exist "%~dp0script" md "%~dp0script"
|
||||
|
||||
::: 要导出的脚本文件名的前缀(后面还会加上表名)
|
||||
set ScriptnamePrefix=%~dp0script\%date:~0,4%%date:~5,2%%date:~8,2%
|
||||
|
||||
::: 判断脚本是否存在, 存在则删除
|
||||
::if exist %Scriptname% del %Scriptname%
|
||||
|
||||
:export
|
||||
echo 开始导出游戏基础信息脚本
|
||||
for %%t in (%ExportTable_base%) do (
|
||||
::: 判断脚本是否存在, 存在则删除
|
||||
if exist "%ScriptnamePrefix%_base_%%t.sql" del "%ScriptnamePrefix%_base_%%t.sql"
|
||||
|
||||
::: 循环导出脚本
|
||||
echo 导出表%%t到%ScriptnamePrefix%_base_%%t.sql
|
||||
%ExportBinary% --default-character-set=utf8 --opt -h%Hostname_base% -P%Hostport_base% -u%Username_base% -p%Password_base% %Database_base% %%t > "%ScriptnamePrefix%_base_%%t.sql"
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
)
|
||||
echo 游戏基础信息脚本导出完成
|
||||
|
||||
echo 开始导出游戏战绩脚本
|
||||
for %%t in (%ExportTable_record%) do (
|
||||
::: 判断脚本是否存在, 存在则删除
|
||||
if exist "%ScriptnamePrefix%_record_%%t.sql" del "%ScriptnamePrefix%_record_%%t.sql"
|
||||
|
||||
::: 循环导出脚本
|
||||
echo 导出表%%t到%ScriptnamePrefix%_record_%%t.sql
|
||||
%ExportBinary% --default-character-set=utf8 --opt -h%Hostname_record% -P%Hostport_record% -u%Username_record% -p%Password_record% %Database_record% %%t > "%ScriptnamePrefix%_record_%%t.sql"
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
)
|
||||
echo 游戏战绩脚本导出完成
|
||||
|
||||
:import
|
||||
echo 开始导入游戏基础信息脚本
|
||||
for %%t in (%ExportTable_base%) do (
|
||||
echo 从%ScriptnamePrefix%_base_%%t.sql导入表%%t
|
||||
%ImportBinary% --default-character-set=utf8 -h%Hostname_owner% -P%Hostport_owner% -u%Username_owner% -p%Password_owner% %Database_owner_temp% < "%ScriptnamePrefix%_base_%%t.sql"
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
)
|
||||
echo 游戏基础信息脚本导入完成
|
||||
|
||||
echo 开始导入游戏战绩脚本
|
||||
for %%t in (%ExportTable_record%) do (
|
||||
echo 从%ScriptnamePrefix%_record_%%t.sql导入表%%t
|
||||
%ImportBinary% --default-character-set=utf8 -h%Hostname_owner% -P%Hostport_owner% -u%Username_owner% -p%Password_owner% %Database_owner_temp% < "%ScriptnamePrefix%_record_%%t.sql"
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
)
|
||||
echo 游戏战绩脚本导入完成
|
||||
|
||||
:synchronize
|
||||
echo 执行脚本%ExecuteCommand_1%
|
||||
%ImportBinary% -h%Hostname_owner% -P%Hostport_owner% -u%Username_owner% -p%Password_owner% -e%ExecuteCommand_1% %Database_owner%
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
echo 脚本执行完成
|
||||
|
||||
if %NeedSaveToTemp% equ 0 goto convertdata
|
||||
|
||||
:savetotemp
|
||||
echo 开始导入游戏基础信息脚本到临时库
|
||||
for %%t in (%ExportTable_base%) do (
|
||||
echo 从%ScriptnamePrefix%_base_%%t.sql导入表%%t
|
||||
%ImportBinary% --default-character-set=utf8 -h%Hostname_temp% -P%Hostport_temp% -u%Username_temp% -p%Password_temp% %Database_temp_temp% < "%ScriptnamePrefix%_base_%%t.sql"
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
)
|
||||
echo 游戏基础信息脚本导入完成
|
||||
|
||||
echo 开始导入游戏战绩脚本到临时库
|
||||
for %%t in (%ExportTable_record%) do (
|
||||
echo 从%ScriptnamePrefix%_record_%%t.sql导入表%%t
|
||||
%ImportBinary% --default-character-set=utf8 -h%Hostname_temp% -P%Hostport_temp% -u%Username_temp% -p%Password_temp% %Database_temp_temp% < "%ScriptnamePrefix%_record_%%t.sql"
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
)
|
||||
echo 游戏战绩脚本导入完成
|
||||
|
||||
|
||||
echo 执行同步脚本
|
||||
echo 执行脚本%ExecuteCommand_1%
|
||||
%ImportBinary% -h%Hostname_temp% -P%Hostport_temp% -u%Username_temp% -p%Password_temp% -e%ExecuteCommand_1% %Database_temp%
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
echo 脚本执行完成
|
||||
|
||||
:convertdata
|
||||
::"%~dp0MySqlSynchronize.exe"
|
||||
|
||||
:clean
|
||||
echo 删除脚本文件
|
||||
for %%t in (%ExportTable_base%) do del "%ScriptnamePrefix%_base_%%t.sql"
|
||||
for %%t in (%ExportTable_record%) do del "%ScriptnamePrefix%_record_%%t.sql"
|
||||
echo 脚本删除完成
|
||||
|
||||
:sync_recorddata
|
||||
echo %date% %time%
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::: 同步报表
|
||||
|
||||
:sync_reportdata
|
||||
::: ts已修改2021 xpxman
|
||||
:::echo 开始同步报表数据(https://dlapi.tscce.cn/ext/SynchronizeReportData.php)
|
||||
:::"%~dp0HttpRequest.x64.exe" -type post -address "https://dlapi.tscce.cn/ext/SynchronizeReportData.php" -parameter "" -interval 1000 -thread 1 -loop 0 >> "%~dp0debug.txt"
|
||||
:::echo 开始生成报表数据(https://dlapi.tscce.cn/ext/autotask.php)
|
||||
:::"%~dp0HttpRequest.x64.exe" -type post -address "https://dlapi.tscce.cn/ext/autotask.php" -parameter "" -interval 1000 -thread 1 -loop 0 >> "%~dp0debug.txt"
|
||||
|
||||
echo 开始同步报表数据(https://dlapi.daoqijuyou77.cn/ext/SynchronizeReportData.php)
|
||||
"%~dp0HttpRequest.x64.exe" -type post -address "https://dlapi.daoqijuyou77.cn/ext/SynchronizeReportData.php" -parameter "" -interval 1000 -thread 1 -loop 0 >> "%~dp0debug.txt"
|
||||
echo 开始生成报表数据(https://dlapi.daoqijuyou77.cn/ext/autotask.php)
|
||||
"%~dp0HttpRequest.x64.exe" -type post -address "https://dlapi.daoqijuyou77.cn/ext/autotask.php" -parameter "" -interval 1000 -thread 1 -loop 0 >> "%~dp0debug.txt"
|
||||
|
||||
|
||||
|
||||
|
||||
:exit_reportdata
|
||||
echo %date% %time%
|
||||
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::: 备份数据库
|
||||
:backup_database
|
||||
for /f "tokens=1-3 delims=/-, " %%a in ('echo/%date%') do (
|
||||
set yy=%%a & set mm=%%b & set dd=%%c
|
||||
)
|
||||
set /a dd=100%dd%%%100,mm=100%mm%%%100
|
||||
set /a z=14-mm,z/=12,y=yy+4800-z,m=mm+12*z-3,j=153*m+2
|
||||
set /a j=j/5+dd+y*365+y/4-y/100+y/400-2472633
|
||||
|
||||
set /a j=j-7
|
||||
|
||||
set /a i=j,a=i+2472632,b=4*a+3,b/=146097,c=-b*146097,c/=4,c+=a
|
||||
set /a d=4*c+3,d/=1461,e=-1461*d,e/=4,e+=c,m=5*e+2,m/=153,dd=153*m+2,dd/=5
|
||||
set /a dd=-dd+e+1,mm=-m/10,mm*=12,mm+=m+3,yy=b*100+d-4800+m/10
|
||||
(if %mm% LSS 10 set mm=0%mm%)&(if %dd% LSS 10 set dd=0%dd%)
|
||||
|
||||
set fdate=%yy%-%mm%-%dd%
|
||||
echo %fdate%
|
||||
|
||||
set mysqldump=C:\xampp\mysql\bin\mysqldump.exe
|
||||
set mysql=C:\xampp\mysql\bin\mysql.exe
|
||||
set winrar=C:\Program Files\WinRAR\rar.exe
|
||||
set needupload=0
|
||||
|
||||
::echo ================
|
||||
|
||||
::echo 开始备份oracle(dbcenter)
|
||||
::if exist "%~dp0dbcenter_%yy%%mm%%dd%.dmp" del "%~dp0dbcenter_%yy%%mm%%dd%.dmp"
|
||||
::if exist "%~dp0dbcenter_%yy%%mm%%dd%.log" del "%~dp0dbcenter_%yy%%mm%%dd%.log"
|
||||
|
||||
::set NLS_LANG=AMERICAN_AMERICA.AL32UTF8
|
||||
::set ORACLE_HOME=D:\app\kingsoft\virtual\product\12.2.0\dbhome_1
|
||||
::exp '"/ as sysdba"' file="%~dp0dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.dmp" log="%~dp0dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.log" grants=y full=y statistics=none
|
||||
::echo 备份oracle(dbcenter)结束
|
||||
|
||||
::echo ================
|
||||
|
||||
::echo 开始备份mysql(tswldb)
|
||||
::if exist "%~dp0tswldb_%yy%%mm%%dd%.sql" del "%~dp0tswldb_%yy%%mm%%dd%.sql"
|
||||
::"%mysqldump%" --default-character-set=utf8 --opt --lock-all-tables -x -h"localhost" -P"3309" -u"root" -p"root_root" -R "tswldb" > ::"%~dp0tswldb_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::echo 备份mysql(tswldb)结束
|
||||
|
||||
::echo ================
|
||||
|
||||
::echo 开始备份mysql(syhd)
|
||||
::if exist "%~dp0syhd_%yy%%mm%%dd%.sql" del "%~dp0syhd_%yy%%mm%%dd%.sql"
|
||||
::"%mysqldump%" --default-character-set=utf8 --opt --lock-all-tables -x -h"localhost" -P"3309" -u"root" -p"root_root" -R "syhd" > "%~dp0syhd_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::echo 备份mysql(syhd)结束
|
||||
|
||||
::echo ================
|
||||
|
||||
::echo 开始备份mysql(game_db)
|
||||
::if exist "%~dp0game_db_localhost_%yy%%mm%%dd%.sql" del "%~dp0game_db_localhost_%yy%%mm%%dd%.sql"
|
||||
::"%mysql%" -h"localhost" -P"3309" -u"root" -p"root_root" -e"truncate table player_grade" game_db
|
||||
::"%mysqldump%" --default-character-set=utf8 --opt --lock-all-tables -x -h"localhost" -P"3309" -u"root" -p"root_root" -R "game_db" > "%~dp0game_db_localhost_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::echo 备份mysql(game_db)结束
|
||||
|
||||
::echo ================
|
||||
|
||||
::echo 开始备份mysql(member)
|
||||
::if exist "%~dp0member_%yy%%mm%%dd%.sql" del "%~dp0youlehudong_%yy%%mm%%dd%.sql"
|
||||
::"%mysqldump%" --default-character-set=utf8 --opt --lock-all-tables -x -h"localhost" -P"3309" -u"root" -p"root_root" -R "member" > "%~dp0member_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::echo 备份mysql(member)结束
|
||||
|
||||
::echo ================
|
||||
|
||||
::echo 开始备份mysql(tryout)
|
||||
::if exist "%~dp0tryout_%yy%%mm%%dd%.sql" del "%~dp0youlehudong_%yy%%mm%%dd%.sql"
|
||||
::"%mysqldump%" --default-character-set=utf8 --opt --lock-all-tables -x -h"localhost" -P"3309" -u"root" -p"root_root" -R "tryout" > "%~dp0tryout_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::echo 备份mysql(tryout)结束
|
||||
|
||||
::echo ================
|
||||
|
||||
::echo 开始备份mysql(dkb)
|
||||
::if exist "%~dp0dkb_%yy%%mm%%dd%.sql" del "%~dp0youlehudong_%yy%%mm%%dd%.sql"
|
||||
::"%mysqldump%" --default-character-set=utf8 --opt --lock-all-tables -x -h"localhost" -P"3309" -u"root" -p"root_root" -R "dkb" > "%~dp0dkb_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::echo 备份mysql(dkb)结束
|
||||
|
||||
::echo ================
|
||||
|
||||
::echo 开始备份mysql(youlehudong)
|
||||
::if exist "%~dp0youlehudong_%yy%%mm%%dd%.sql" del "%~dp0youlehudong_%yy%%mm%%dd%.sql"
|
||||
::"%mysqldump%" --default-character-set=utf8 --opt --lock-all-tables -x -h"rm-wz978o3vha6z26m5no.mysql.rds.aliyuncs.com" -P"3306" -u"tswl_2015" -p"tswl_2015" -R "youlehudong" > "%~dp0youlehudong_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::echo 备份mysql(youlehudong)结束
|
||||
|
||||
echo ================
|
||||
|
||||
echo 开始备份mysql(game_db)
|
||||
"%mysql%" -h"rm-wz978o3vha6z26m5no.mysql.rds.aliyuncs.com" -P"3306" -u"yunuser" -p"Yun_User" -e"truncate table player_grade" game_db
|
||||
"%mysql%" -h"rm-wz978o3vha6z26m5no.mysql.rds.aliyuncs.com" -P"3306" -u"yunuser" -p"Yun_User" -e"truncate table coin_rebate" game_db
|
||||
if exist "%~dp0game_db_%yy%%mm%%dd%.sql" del "%~dp0game_db_%yy%%mm%%dd%.sql"
|
||||
"%mysqldump%" --default-character-set=utf8 --opt --lock-all-tables -x -h"rm-wz978o3vha6z26m5no.mysql.rds.aliyuncs.com" -P"3306" -u"tswl_2015" -p"tswl_2015" -R game_db > "%~dp0game_db_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
echo 备份mysql(game_db)结束
|
||||
|
||||
echo ================
|
||||
|
||||
::: 压缩备份文件
|
||||
::%~d0
|
||||
::cd "%~dp0"
|
||||
::if exist "%~dp0database_%yy%%mm%%dd%.rar" del "%~dp0database_%yy%%mm%%dd%.rar"
|
||||
::"%winrar%" a "database_%date:~0,4%%date:~5,2%%date:~8,2%.rar" "dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.dmp" "dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.log" "tswldb_%date:~0,4%%date:~5,2%%date:~8,2%.sql" "syhd_%date:~0,4%%date:~5,2%%date:~8,2%.sql" "game_db_localhost_%date:~0,4%%date:~5,2%%date:~8,2%.sql" "youlehudong_%date:~0,4%%date:~5,2%%date:~8,2%.sql" "game_db_%date:~0,4%%date:~5,2%%date:~8,2%.sql" "member_%date:~0,4%%date:~5,2%%date:~8,2%.sql" "tryout_%date:~0,4%%date:~5,2%%date:~8,2%.sql" "dkb_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::if %needupload% NEQ 0 (
|
||||
:: ::: 上传压缩文件
|
||||
:: "%~dp0NetworkTool.x64.exe" -st "2" -rt "2" -hn "120.76.157.63" -hp "80" -on "/dbbackup/upload.php" -rd "/" -rf "database_%date:~0,4%%date:~5,2%%date:~8,2%.rar" -lf "%~dp0database_%date:~0,4%%date:~5,2%%date:~8,2%.rar"
|
||||
:: ::: 删除压缩文件
|
||||
:: :::del "database_%date:~0,4%%date:~5,2%%date:~8,2%.rar"
|
||||
::)
|
||||
|
||||
::: 删除备份的文件
|
||||
if exist "%~dp0dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.dmp" del "%~dp0dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.dmp"
|
||||
if exist "%~dp0dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.log" del "%~dp0dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.log"
|
||||
if exist "%~dp0tswldb_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0tswldb_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if exist "%~dp0syhd_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0syhd_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if exist "%~dp0game_db_localhost_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0game_db_localhost_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if exist "%~dp0youlehudong_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0youlehudong_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if exist "%~dp0game_db_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0game_db_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if exist "%~dp0member_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0member_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if exist "%~dp0tryout_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0tryout_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if exist "%~dp0dkb_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0dkb_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
|
||||
::: 备份完毕
|
||||
:exit
|
||||
|
||||
::: 恢复同步服务
|
||||
::"%~dp0CallerService.exe" -start
|
||||
net start CallerService
|
||||
|
||||
echo on
|
||||
@@ -1,220 +0,0 @@
|
||||
echo off
|
||||
echo %date% %time%
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::: ͬ<><CDAC>ս<EFBFBD><D5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
:sync_recorddata
|
||||
|
||||
:init
|
||||
::: ֹͣͬ<D6B9><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
::"%~dp0CallerService.exe" -stop
|
||||
net stop CallerService
|
||||
|
||||
::: mysql<71><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ȫ<EFBFBD><C8AB>
|
||||
set ExportBinary="C:\webroot\dbbackup\mysql\mysqldump.exe"
|
||||
::: mysql<71><6C><EFBFBD>빤<EFBFBD><EBB9A4><EFBFBD>ļ<EFBFBD>ȫ<EFBFBD><C8AB>
|
||||
set ImportBinary="C:\webroot\dbbackup\mysql\mysql.exe"
|
||||
|
||||
|
||||
::: <20><>Ϸ<EFBFBD><CFB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
set Hostname_base="rm-bp1x3i28se22s9z75o.mysql.rds.aliyuncs.com"
|
||||
set Hostport_base="3306"
|
||||
set Username_base="games"
|
||||
set Password_base="Games2017@)!&"
|
||||
set Database_base="game_db"
|
||||
set ExportTable_base=player
|
||||
|
||||
::: <20><>Ϸս<CFB7><D5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
set Hostname_record="rr-bp1x2415jy37d8mu1o.mysql.rds.aliyuncs.com"
|
||||
set Hostport_record="3306"
|
||||
set Username_record="games"
|
||||
set Password_record="Games2017@)!%&"
|
||||
set Database_record="game_db"
|
||||
set ExportTable_record=player_grade,gold_account
|
||||
|
||||
::: <20><>̨<EFBFBD><CCA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
set Hostname_owner="rm-wz978o3vha6z26m5no.mysql.rds.aliyuncs.com"
|
||||
set Hostport_owner="3306"
|
||||
set Username_owner="yunuser"
|
||||
set Password_owner="Yun_User"
|
||||
set Database_owner="game_db"
|
||||
set Database_owner_temp="game_db_temp"
|
||||
|
||||
::: <20><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
set Hostname_temp="localhost"
|
||||
set Hostport_temp="3309"
|
||||
set Username_temp="root"
|
||||
set Password_temp="root_root"
|
||||
set Database_temp="game_db"
|
||||
set Database_temp_temp="game_db_temp"
|
||||
|
||||
::: <20>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>浽<EFBFBD><E6B5BD>ʱ<EFBFBD><CAB1>
|
||||
set NeedSaveToTemp=0
|
||||
|
||||
::: Ҫִ<D2AA>еĽű<C4BD>
|
||||
set ExecuteCommand_1="call cp_SynchronizeSettle();"
|
||||
:::::::::::::: <20><><EFBFBD>뵼<EFBFBD><EBB5BC> -<2D><>ʼ :::::::::::::::::
|
||||
|
||||
|
||||
:::::::::::::: <20><><EFBFBD>뵼<EFBFBD><EBB5BC> - <20><><EFBFBD><EFBFBD> :::::::::::::::::
|
||||
|
||||
:synchronize
|
||||
echo ִ<>нű<D0BD>%ExecuteCommand_1%
|
||||
%ImportBinary% -h%Hostname_owner% -P%Hostport_owner% -u%Username_owner% -p%Password_owner% -e%ExecuteCommand_1% %Database_owner%
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
echo <20>ű<EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::: ͬ<><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
:sync_reportdata
|
||||
::: ts<74><73><EFBFBD><EFBFBD>2021 xpxman
|
||||
:::echo <20><>ʼͬ<CABC><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(https://dlapi.tscce.cn/ext/SynchronizeReportData.php)
|
||||
:::"%~dp0HttpRequest.x64.exe" -type post -address "https://dlapi.tscce.cn/ext/SynchronizeReportData.php" -parameter "" -interval 1000 -thread 1 -loop 0 >> "%~dp0debug.txt"
|
||||
:::echo <20><>ʼ<EFBFBD><CABC><EFBFBD>ɱ<EFBFBD><C9B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(https://dlapi.tscce.cn/ext/autotask.php)
|
||||
:::"%~dp0HttpRequest.x64.exe" -type post -address "https://dlapi.tscce.cn/ext/autotask.php" -parameter "" -interval 1000 -thread 1 -loop 0 >> "%~dp0debug.txt"
|
||||
|
||||
echo <20><>ʼͬ<CABC><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>daoqijuyou77.cnlapi.daoqijuyou.cn/ext/SynchronizeReportData.php)
|
||||
"%~dp0HttpRequest.x64.exe" -type post -address "https://dlapi.daoqijuyou77.cn/ext/SynchronizeReportData.php" -parameter "" -interval 1000 -thread 1 -loop 0 >> "%~dp0debug.txt"
|
||||
echo <20><>ʼ<EFBFBD><CABC><EFBFBD>ɱ<EFBFBD><C9B1><EFBFBD><EFBFBD>daoqijuyou77.cnlapi.daoqijuyou.cn/ext/autotask.php)
|
||||
"%~dp0HttpRequest.x64.exe" -type post -address "https://dlapi.daoqijuyou77.cn/ext/autotask.php" -parameter "" -interval 1000 -thread 1 -loop 0 >> "%~dp0debug.txt"
|
||||
|
||||
|
||||
|
||||
|
||||
:exit_reportdata
|
||||
echo %date% %time%
|
||||
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD>
|
||||
:backup_database
|
||||
for /f "tokens=1-3 delims=/-, " %%a in ('echo/%date%') do (
|
||||
set yy=%%a & set mm=%%b & set dd=%%c
|
||||
)
|
||||
set /a dd=100%dd%%%100,mm=100%mm%%%100
|
||||
set /a z=14-mm,z/=12,y=yy+4800-z,m=mm+12*z-3,j=153*m+2
|
||||
set /a j=j/5+dd+y*365+y/4-y/100+y/400-2472633
|
||||
|
||||
set /a j=j-7
|
||||
|
||||
set /a i=j,a=i+2472632,b=4*a+3,b/=146097,c=-b*146097,c/=4,c+=a
|
||||
set /a d=4*c+3,d/=1461,e=-1461*d,e/=4,e+=c,m=5*e+2,m/=153,dd=153*m+2,dd/=5
|
||||
set /a dd=-dd+e+1,mm=-m/10,mm*=12,mm+=m+3,yy=b*100+d-4800+m/10
|
||||
(if %mm% LSS 10 set mm=0%mm%)&(if %dd% LSS 10 set dd=0%dd%)
|
||||
|
||||
set fdate=%yy%-%mm%-%dd%
|
||||
echo %fdate%
|
||||
|
||||
set mysqldump=C:\xampp\mysql\bin\mysqldump.exe
|
||||
set mysql=C:\xampp\mysql\bin\mysql.exe
|
||||
set winrar=C:\Program Files\WinRAR\rar.exe
|
||||
set needupload=0
|
||||
|
||||
::echo ================
|
||||
|
||||
::echo <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>oracle(dbcenter)
|
||||
::if exist "%~dp0dbcenter_%yy%%mm%%dd%.dmp" del "%~dp0dbcenter_%yy%%mm%%dd%.dmp"
|
||||
::if exist "%~dp0dbcenter_%yy%%mm%%dd%.log" del "%~dp0dbcenter_%yy%%mm%%dd%.log"
|
||||
|
||||
::set NLS_LANG=AMERICAN_AMERICA.AL32UTF8
|
||||
::set ORACLE_HOME=D:\app\kingsoft\virtual\product\12.2.0\dbhome_1
|
||||
::exp '"/ as sysdba"' file="%~dp0dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.dmp" log="%~dp0dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.log" grants=y full=y statistics=none
|
||||
::echo <20><><EFBFBD><EFBFBD>oracle(dbcenter)<29><><EFBFBD><EFBFBD>
|
||||
|
||||
::echo ================
|
||||
|
||||
::echo <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>mysql(tswldb)
|
||||
::if exist "%~dp0tswldb_%yy%%mm%%dd%.sql" del "%~dp0tswldb_%yy%%mm%%dd%.sql"
|
||||
::"%mysqldump%" --default-character-set=utf8 --opt --lock-all-tables -x -h"localhost" -P"3309" -u"root" -p"root_root" -R "tswldb" > ::"%~dp0tswldb_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::echo <20><><EFBFBD><EFBFBD>mysql(tswldb)<29><><EFBFBD><EFBFBD>
|
||||
|
||||
::echo ================
|
||||
|
||||
::echo <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>mysql(syhd)
|
||||
::if exist "%~dp0syhd_%yy%%mm%%dd%.sql" del "%~dp0syhd_%yy%%mm%%dd%.sql"
|
||||
::"%mysqldump%" --default-character-set=utf8 --opt --lock-all-tables -x -h"localhost" -P"3309" -u"root" -p"root_root" -R "syhd" > "%~dp0syhd_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::echo <20><><EFBFBD><EFBFBD>mysql(syhd)<29><><EFBFBD><EFBFBD>
|
||||
|
||||
::echo ================
|
||||
|
||||
::echo <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>mysql(game_db)
|
||||
::if exist "%~dp0game_db_localhost_%yy%%mm%%dd%.sql" del "%~dp0game_db_localhost_%yy%%mm%%dd%.sql"
|
||||
::"%mysql%" -h"localhost" -P"3309" -u"root" -p"root_root" -e"truncate table player_grade" game_db
|
||||
::"%mysqldump%" --default-character-set=utf8 --opt --lock-all-tables -x -h"localhost" -P"3309" -u"root" -p"root_root" -R "game_db" > "%~dp0game_db_localhost_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::echo <20><><EFBFBD><EFBFBD>mysql(game_db)<29><><EFBFBD><EFBFBD>
|
||||
|
||||
::echo ================
|
||||
|
||||
::echo <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>mysql(member)
|
||||
::if exist "%~dp0member_%yy%%mm%%dd%.sql" del "%~dp0youlehudong_%yy%%mm%%dd%.sql"
|
||||
::"%mysqldump%" --default-character-set=utf8 --opt --lock-all-tables -x -h"localhost" -P"3309" -u"root" -p"root_root" -R "member" > "%~dp0member_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::echo <20><><EFBFBD><EFBFBD>mysql(member)<29><><EFBFBD><EFBFBD>
|
||||
|
||||
::echo ================
|
||||
|
||||
::echo <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>mysql(tryout)
|
||||
::if exist "%~dp0tryout_%yy%%mm%%dd%.sql" del "%~dp0youlehudong_%yy%%mm%%dd%.sql"
|
||||
::"%mysqldump%" --default-character-set=utf8 --opt --lock-all-tables -x -h"localhost" -P"3309" -u"root" -p"root_root" -R "tryout" > "%~dp0tryout_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::echo <20><><EFBFBD><EFBFBD>mysql(tryout)<29><><EFBFBD><EFBFBD>
|
||||
|
||||
::echo ================
|
||||
|
||||
::echo <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>mysql(dkb)
|
||||
::if exist "%~dp0dkb_%yy%%mm%%dd%.sql" del "%~dp0youlehudong_%yy%%mm%%dd%.sql"
|
||||
::"%mysqldump%" --default-character-set=utf8 --opt --lock-all-tables -x -h"localhost" -P"3309" -u"root" -p"root_root" -R "dkb" > "%~dp0dkb_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::echo <20><><EFBFBD><EFBFBD>mysql(dkb)<29><><EFBFBD><EFBFBD>
|
||||
|
||||
::echo ================
|
||||
|
||||
::echo <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>mysql(youlehudong)
|
||||
::if exist "%~dp0youlehudong_%yy%%mm%%dd%.sql" del "%~dp0youlehudong_%yy%%mm%%dd%.sql"
|
||||
::"%mysqldump%" --default-character-set=utf8 --opt --lock-all-tables -x -h"rm-wz978o3vha6z26m5no.mysql.rds.aliyuncs.com" -P"3306" -u"tswl_2015" -p"tswl_2015" -R "youlehudong" > "%~dp0youlehudong_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::echo <20><><EFBFBD><EFBFBD>mysql(youlehudong)<29><><EFBFBD><EFBFBD>
|
||||
|
||||
echo ================
|
||||
|
||||
echo <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>mysql(game_db)
|
||||
"%mysql%" -h"rm-wz978o3vha6z26m5no.mysql.rds.aliyuncs.com" -P"3306" -u"yunuser" -p"Yun_User" -e"truncate table player_grade" game_db
|
||||
"%mysql%" -h"rm-wz978o3vha6z26m5no.mysql.rds.aliyuncs.com" -P"3306" -u"yunuser" -p"Yun_User" -e"truncate table coin_rebate" game_db
|
||||
if exist "%~dp0game_db_%yy%%mm%%dd%.sql" del "%~dp0game_db_%yy%%mm%%dd%.sql"
|
||||
"%mysqldump%" --default-character-set=utf8 --opt --lock-all-tables -x -h"rm-wz978o3vha6z26m5no.mysql.rds.aliyuncs.com" -P"3306" -u"tswl_2015" -p"tswl_2015" -R game_db > "%~dp0game_db_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
echo <20><><EFBFBD><EFBFBD>mysql(game_db)<29><><EFBFBD><EFBFBD>
|
||||
|
||||
echo ================
|
||||
|
||||
::: ѹ<><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
||||
::%~d0
|
||||
::cd "%~dp0"
|
||||
::if exist "%~dp0database_%yy%%mm%%dd%.rar" del "%~dp0database_%yy%%mm%%dd%.rar"
|
||||
::"%winrar%" a "database_%date:~0,4%%date:~5,2%%date:~8,2%.rar" "dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.dmp" "dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.log" "tswldb_%date:~0,4%%date:~5,2%%date:~8,2%.sql" "syhd_%date:~0,4%%date:~5,2%%date:~8,2%.sql" "game_db_localhost_%date:~0,4%%date:~5,2%%date:~8,2%.sql" "youlehudong_%date:~0,4%%date:~5,2%%date:~8,2%.sql" "game_db_%date:~0,4%%date:~5,2%%date:~8,2%.sql" "member_%date:~0,4%%date:~5,2%%date:~8,2%.sql" "tryout_%date:~0,4%%date:~5,2%%date:~8,2%.sql" "dkb_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
::if %needupload% NEQ 0 (
|
||||
:: ::: <20>ϴ<EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>ļ<EFBFBD>
|
||||
:: "%~dp0NetworkTool.x64.exe" -st "2" -rt "2" -hn "120.76.157.63" -hp "80" -on "/dbbackup/upload.php" -rd "/" -rf "database_%date:~0,4%%date:~5,2%%date:~8,2%.rar" -lf "%~dp0database_%date:~0,4%%date:~5,2%%date:~8,2%.rar"
|
||||
:: ::: ɾ<><C9BE>ѹ<EFBFBD><D1B9><EFBFBD>ļ<EFBFBD>
|
||||
:: :::del "database_%date:~0,4%%date:~5,2%%date:~8,2%.rar"
|
||||
::)
|
||||
|
||||
::: ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5>ļ<EFBFBD>
|
||||
if exist "%~dp0dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.dmp" del "%~dp0dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.dmp"
|
||||
if exist "%~dp0dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.log" del "%~dp0dbcenter_%date:~0,4%%date:~5,2%%date:~8,2%.log"
|
||||
if exist "%~dp0tswldb_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0tswldb_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if exist "%~dp0syhd_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0syhd_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if exist "%~dp0game_db_localhost_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0game_db_localhost_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if exist "%~dp0youlehudong_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0youlehudong_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if exist "%~dp0game_db_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0game_db_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if exist "%~dp0member_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0member_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if exist "%~dp0tryout_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0tryout_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
if exist "%~dp0dkb_%date:~0,4%%date:~5,2%%date:~8,2%.sql" del "%~dp0dkb_%date:~0,4%%date:~5,2%%date:~8,2%.sql"
|
||||
|
||||
::: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
:exit
|
||||
|
||||
::: <20>ָ<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
::"%~dp0CallerService.exe" -start
|
||||
net start CallerService
|
||||
|
||||
echo on
|
||||
@@ -1,107 +0,0 @@
|
||||
echo off
|
||||
echo %date% %time%
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::: 同步战绩数据
|
||||
:sync_recorddata
|
||||
|
||||
:init
|
||||
::: 停止同步服务
|
||||
::"%~dp0CallerService.exe" -stop
|
||||
::net stop CallerService
|
||||
::net stop HttpRequestService
|
||||
|
||||
::: mysql导出工具文件全名
|
||||
set ExportBinary="C:\webroot\dbbackup\mysql\mysqldump.exe"
|
||||
::: mysql导入工具文件全名
|
||||
set ImportBinary="C:\webroot\dbbackup\mysql\mysql.exe"
|
||||
|
||||
|
||||
::: 游戏基础信息服务器配置
|
||||
set Hostname_base="rm-bp1x3i28se22s9z75o.mysql.rds.aliyuncs.com"
|
||||
set Hostport_base="3306"
|
||||
set Username_base="games"
|
||||
set Password_base="Games2017@)!&"
|
||||
set Database_base="game_db"
|
||||
set ExportTable_base=player
|
||||
|
||||
::: 游戏战绩服务器配置
|
||||
set Hostname_record="rr-bp1x2415jy37d8mu1o.mysql.rds.aliyuncs.com"
|
||||
set Hostport_record="3306"
|
||||
set Username_record="games"
|
||||
set Password_record="Games2017@)!&"
|
||||
set Database_record="game_db"
|
||||
set ExportTable_record=player_grade,gold_account
|
||||
|
||||
::: 后台服务器配置
|
||||
set Hostname_owner="rm-wz978o3vha6z26m5no.mysql.rds.aliyuncs.com"
|
||||
set Hostport_owner="3306"
|
||||
set Username_owner="yunuser"
|
||||
set Password_owner="Yun_User"
|
||||
set Database_owner="game_db"
|
||||
set Database_owner_temp="game_db_temp"
|
||||
|
||||
::: 临时服务器配置
|
||||
set Hostname_temp="localhost"
|
||||
set Hostport_temp="3309"
|
||||
set Username_temp="root"
|
||||
set Password_temp="root_root"
|
||||
set Database_temp="game_db"
|
||||
set Database_temp_temp="game_db_temp"
|
||||
|
||||
::: 是否需要保存到临时库
|
||||
set NeedSaveToTemp=0
|
||||
|
||||
::: 要执行的脚本
|
||||
set ExecuteCommand_1="call cp_SynchronizeSettle();"
|
||||
|
||||
::: 保证脚本输出目录一定存在
|
||||
if not exist "%~dp0script" md "%~dp0script"
|
||||
|
||||
::: 要导出的脚本文件名的前缀(后面还会加上表名)
|
||||
set ScriptnamePrefix=%~dp0script\%date:~0,4%%date:~5,2%%date:~8,2%
|
||||
|
||||
::: 判断脚本是否存在, 存在则删除
|
||||
::if exist %Scriptname% del %Scriptname%
|
||||
|
||||
:export
|
||||
echo 开始导出游戏基础信息脚本
|
||||
for %%t in (%ExportTable_base%) do (
|
||||
::: 判断脚本是否存在, 存在则删除
|
||||
if exist "%ScriptnamePrefix%_base_%%t.sql" del "%ScriptnamePrefix%_base_%%t.sql"
|
||||
|
||||
::: 循环导出脚本
|
||||
echo 导出表%%t到%ScriptnamePrefix%_base_%%t.sql
|
||||
%ExportBinary% --default-character-set=utf8 --opt -h%Hostname_base% -P%Hostport_base% -u%Username_base% -p%Password_base% %Database_base% %%t > "%ScriptnamePrefix%_base_%%t.sql"
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
)
|
||||
echo 游戏基础信息脚本导出完成
|
||||
|
||||
echo 开始导出游戏战绩脚本
|
||||
for %%t in (%ExportTable_record%) do (
|
||||
::: 判断脚本是否存在, 存在则删除
|
||||
if exist "%ScriptnamePrefix%_record_%%t.sql" del "%ScriptnamePrefix%_record_%%t.sql"
|
||||
|
||||
::: 循环导出脚本
|
||||
echo 导出表%%t到%ScriptnamePrefix%_record_%%t.sql
|
||||
%ExportBinary% --default-character-set=utf8 --opt -h%Hostname_record% -P%Hostport_record% -u%Username_record% -p%Password_record% %Database_record% %%t > "%ScriptnamePrefix%_record_%%t.sql"
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
)
|
||||
echo 游戏战绩脚本导出完成
|
||||
|
||||
:import
|
||||
echo 开始导入游戏基础信息脚本
|
||||
for %%t in (%ExportTable_base%) do (
|
||||
echo 从%ScriptnamePrefix%_base_%%t.sql导入表%%t
|
||||
%ImportBinary% --default-character-set=utf8 -h%Hostname_owner% -P%Hostport_owner% -u%Username_owner% -p%Password_owner% %Database_owner_temp% < "%ScriptnamePrefix%_base_%%t.sql"
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
)
|
||||
echo 游戏基础信息脚本导入完成
|
||||
|
||||
echo 开始导入游戏战绩脚本
|
||||
for %%t in (%ExportTable_record%) do (
|
||||
echo 从%ScriptnamePrefix%_record_%%t.sql导入表%%t
|
||||
%ImportBinary% --default-character-set=utf8 -h%Hostname_owner% -P%Hostport_owner% -u%Username_owner% -p%Password_owner% %Database_owner_temp% < "%ScriptnamePrefix%_record_%%t.sql"
|
||||
if %errorlevel% neq 0 goto exit_recorddata
|
||||
)
|
||||
echo 游戏战绩脚本导入完成
|
||||
::net start HttpRequestService
|
||||
@@ -1,46 +0,0 @@
|
||||
for %%p in (
|
||||
2018-09-01,
|
||||
2018-09-02,
|
||||
2018-09-03,
|
||||
2018-09-04,
|
||||
2018-09-05,
|
||||
2018-09-06,
|
||||
2018-09-07,
|
||||
2018-09-08,
|
||||
2018-09-09,
|
||||
2018-09-10,
|
||||
2018-09-11,
|
||||
2018-09-12,
|
||||
2018-09-13,
|
||||
2018-09-14,
|
||||
2018-09-15,
|
||||
2018-09-16,
|
||||
2018-09-17,
|
||||
2018-09-18,
|
||||
2018-09-19,
|
||||
2018-09-20,
|
||||
2018-09-21,
|
||||
2018-09-22,
|
||||
2018-09-23,
|
||||
2018-09-24,
|
||||
2018-09-25,
|
||||
2018-09-26,
|
||||
2018-09-27,
|
||||
2018-09-28,
|
||||
2018-09-29,
|
||||
2018-09-30
|
||||
) do (
|
||||
::"%~dp0HttpRequest.x64.exe" -type post -address "https://dlapi.tscce.cn/ext/autotask.php" -parameter "sync_date=%%p" -interval 1000 -thread 1 -loop 0
|
||||
"C:\webroot\dbbackup\mysql\mysql.exe" -h"rm-wz978o3vha6z26m5no.mysql.rds.aliyuncs.com" -P"3306" -u"yunuser" -p"Yun_User" -e"call ct_CreateGoldBalanceData('%%p')" "game_db"
|
||||
)
|
||||
pause
|
||||
exit
|
||||
|
||||
truncate table ct_report_player_room_open;
|
||||
truncate table ct_report_player_roomcard_use;
|
||||
truncate table ct_report_player_roomcard_record;
|
||||
truncate table ct_report_player_star_record;
|
||||
truncate table ct_report_player_buy_record;
|
||||
truncate table ct_report_sales_roomcard_buy;
|
||||
truncate table ct_report_sales_charge_record;
|
||||
truncate table ct_report_sales_login_record;
|
||||
Reference in New Issue
Block a user