Sfoglia il codice sorgente

修改文件格式

seyason 1 anno fa
parent
commit
a4f9ae85bc

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet_deploy/auto_deploy.sh

@@ -0,0 +1 @@
+sh bkup.sh;sh copyFiles.sh

+ 2 - 0
fhKeeper/formulahousekeeper/timesheet_deploy/bkup.sh

@@ -0,0 +1,2 @@
+mysqldump -h10.1.10.33 -uroot -pMld2022@# -B man_mld > ./man_mld.sql
+echo 'db backup successful'

+ 41 - 0
fhKeeper/formulahousekeeper/timesheet_deploy/bkup_script_win.bat

@@ -0,0 +1,41 @@
+@echo 开始备份数据库。 
+set "ymd=%date:~,4%%date:~5,2%%date:~8,2%"
+ 
+@备份数据库目录 
+set "bak_path=D:\data_xxxx"
+ 
+@数据库安装目录
+set "mysql_dump_path=D:\xxxxx\mysql-winx64\bin"
+ 
+@数据库账号
+set "dbuser=xxxxxx"
+ 
+@数据库密码
+set "dbpwd=xxxxxx"
+ 
+@数据库IP地址
+set "dbip=xxx.xxx.xx.xxx"
+ 
+@数据库端口
+set "dbport=xxxx"
+ 
+@备份保存时间,单位: 天
+set "dateoutday=x"
+ 
+@备份数据库名称,如果是all则是所有的数据
+set "dbname=all"
+ 
+if "%dbname%" == "all" (
+  
+@连接数据库及要备份的库u账号、p密码、h账号IP
+"%mysql_dump_path%"\mysqldump -u%dbuser% -p%dbpwd% -h%dbip% -P%dbport% --all-databases  --set-gtid-purged=OFF --triggers --routines --events > %bak_path%\qkbf_bak%ymd%.sql  
+)else (
+  echo "++++++++++++++++++++++"%dbname%"+++++++++++++++++++++++"
+ 
+@连接数据库及要备份的库u账号、p密码、h账号IP
+"%mysql_dump_path%"\mysqldump -u%dbuser% -p%dbpwd% -h%dbip% -P%dbport% --databases %dbname% > %bak_path%\%dbname%_bak%ymd%.sql 
+)
+ 
+@echo 删除3天前备份的文件。
+forfiles /p "%bak_path%" /s /m *.sql /d -%dateoutday% /c "cmd /c del @path"
+@echo 数据库备份完成,3秒后程序退出

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_deploy/copyFiles.sh

@@ -1,2 +1,2 @@
 \cp timesheet-3.4.0.jar /www/webapps/worktime/;\cp -rf static_pc/dist/* /www/staticproject/timesheet/;\cp -rf static_h5/dist/* /www/staticproject/timesheet_h5/;
-echo 'all files are copied successful, if there is db script, you should run sh import_sql.sh; then you can restart server with command: sh /www/webapps/worktime/restart.sh'
+echo 'all files are copied successful, if there is db script, you should run sh import_sql.sh; then you can cd /www/webapps/worktime/ and restart server with command: sh restart.sh'

+ 2 - 0
fhKeeper/formulahousekeeper/timesheet_deploy/custom_db_bk.sh

@@ -0,0 +1,2 @@
+# 替换$HOST_IP, $PASSWORD, $DB_NAME
+mysqldump -h$HOST_IP -uroot -p$PASSWORD -B $DB_NAME > $DB_NAME.sql

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet_deploy/import_sql.sh

@@ -0,0 +1 @@
+mysql -uroot -pMld2022@# man_mld < update_script.sql

BIN
fhKeeper/formulahousekeeper/timesheet_deploy/windows创建备份任务计划.docx