whyclj
2019-07-26 79004d812d6fbaceab22f64a2776cbc831ba416c
BattMonitor_FBS9100S_DataBaseBackUp/src/com/backup/DataBaseBackUpThread.java
@@ -73,9 +73,17 @@
               lastRecodTime = nowTime;
               DataBaseBackUpThread_SQL.inseartBackupTable(pool,list);
               
               ZipUtil zipUtil = new ZipUtil();
               String zipName = path+".zip";
               File zipFile = zipUtil.createZip(zipName, new File(path));   //压缩数据库文件
               HzipSocket SocketClient = new HzipSocket();
               SocketClient.init(path);                     //发送数据库备份文件到远程服务器
               SocketClient.init(zipName);                     //发送数据库备份文件到远程服务器
               System.out.println("远程备份数据库完成" + Com.getDateTimeFormat(new Date(), Com.DTF_YMDhms));
               if(zipFile.exists() && zipFile.length() > 1*1024 && new File(path).exists()) {
                  deleteDir(new File(path));
               }
            }
            
            //查询所有需要备份指定数据库的记录
@@ -103,7 +111,14 @@
                     DataBaseBackUpThread_SQL.UpdateDataBaseState(pool, table);
                  }
               }
               if( count > 0) {
                  ZipUtil zipUtil = new ZipUtil();
                  String zipName = path+".zip";
                  File zipFile = zipUtil.createZip(zipName, new File(path));   //压缩数据库文件
                  if(zipFile.exists() && zipFile.length() > 1*1024 && new File(path).exists()) {
                     deleteDir(new File(path));
                  }
                  System.out.println("开始备份"+count+"个表    at "+Com.getDateTimeFormat(nowTime, Com.DTF_YMD_h_m_s));
               }
            }            
@@ -119,7 +134,7 @@
    * @return
    */
   public static Date createNomalDate(Date time) {
      String time_str = Com.getDateTimeFormat(time, Com.DTF_YMD) + " 23:59:30";
      String time_str = Com.getDateTimeFormat(time, Com.DTF_YMD) + " 10:36:30";
      //System.out.println(time_str);
      return Com.getDateTimeFromStr(time_str, Com.DTF_YMDhms);
   }