当前位置: 首页 > news >正文

关键词是什么宁波seo优化流程

关键词是什么,宁波seo优化流程,北京市房山建设培训学校网站,朝阳网站建设 慈云寺数据越积越多#xff0c;过于冗余#xff1b;数据库定期删除指定时间前的数据#xff1b;文件生成的删除指定时间前端文件 SFTP文件定期删除 java sftp 定时清理指定文件中固定时间 依赖 !-- ftp文件上传/下载Jar包 -- dependencygroupIdcom.jc…数据越积越多过于冗余数据库定期删除指定时间前的数据文件生成的删除指定时间前端文件 SFTP文件定期删除 java sftp 定时清理指定文件中固定时间 依赖 !-- ftp文件上传/下载Jar包 -- dependencygroupIdcom.jcraft/groupIdartifactIdjsch/artifactIdversion0.1.54/version /dependency代码 import com.jcraft.jsch.*;import java.util.Vector;/*** java sftp 定时清理指定文件中固定时间*/ public class SftpCleanup {public static void main(String[] args) throws JSchException {String host 127.0.0.1; // SFTP主机地址int port 22; // SFTP端口号String username xxx; // SFTP登录用户名String password xxxx; // SFTP登录密码Session session null;ChannelSftp channelSftp null;try {JSch jsch new JSch();// 创建Session对象session jsch.getSession(username, host, port);session.setPassword(password);session.setConfig(StrictHostKeyChecking, no);session.connect();// 打开ChannelSftp通道channelSftp (ChannelSftp) session.openChannel(sftp);channelSftp.connect();// 设置删除目标文件的路径及过期时间单位为分钟// 默认为当前日期之前的24小时内的文件将被删除//long expireTimeInMinutes 60 * 24;long currentTimeMillis System.currentTimeMillis();//long threeMonthsAgoInMillis currentTimeMillis - 2 * 7 * 60 * 60 * 1000L; // 当前时间减去N个天的毫秒数long threeMonthsAgoInMillis currentTimeMillis - 90 * 24 * 60 * 60 * 1000L; // 当前时间减去3个月(3*30)的毫秒数String targetPath /data/file/hi/; // 目标文件路径VectorChannelSftp.LsEntry fileList channelSftp.ls(targetPath); // 要清理的目标文件所在路径for (ChannelSftp.LsEntry entry : fileList) {if (!entry.getAttrs().isDir()) {long fileCreationTime entry.getAttrs().getMTime() * 1000L;printTimeDifference(true, fileCreationTime, threeMonthsAgoInMillis);if (fileCreationTime threeMonthsAgoInMillis) {channelSftp.rm(targetPath entry.getFilename()); // 删除符合条件的文件System.out.println(成功删除文件 targetPath entry.getFilename());} else {System.out.println(未到达过期时间不处理文件 targetPath entry.getFilename());}}}} catch (JSchException | SftpException e) {e.printStackTrace();} finally {// 关闭ChannelSftp通道和会话if (channelSftp ! null channelSftp.isConnected()) {channelSftp.disconnect();}if (session ! null session.isConnected()) {session.disconnect();}}}/*** 打印计算时间差** param fileCreationTime sftpFileTime* param presetsTimeMillis threeMonthsAgoInMillis*/private static void printTimeDifference(boolean debugger, long fileCreationTime, long presetsTimeMillis) {// 计算两者之间的差值单位微秒long diffMicroseconds (fileCreationTime - presetsTimeMillis);// 将差值转化为小时、分钟和秒int days (int) (diffMicroseconds / (24 * 60 * 60 * 1000));int hours (int) (diffMicroseconds / (60 * 60 * 1000));int minutes (int) ((diffMicroseconds % (60 * 60 * 1000)) / (60 * 1000));int seconds (int) ((diffMicroseconds % (60 * 1000)) / 1000);// 输出结果//System.out.println(差值为 diffMicroseconds 微秒);if (debugger) {System.out.println(差值为 days 天 hours 小时 minutes 分钟 seconds 秒);}} } mysql保存N个月的数据 mysql中保存3个月的数据当超过3个月之后定时清除3个月之前的数据 Mysql -- 至少保留一个月数据量 delete from table_name SELECT DATE_SUB(NOW(), INTERVAL 1 MONTH); select count(*) from table_name where create_time DATE_SUB(NOW(), INTERVAL 1 MONTH);Api public void deleteCustomerTouch(String monthNum) {if (StringUtils.isBlank(monthNum)) {monthNum YsConst.Month.THREE;}//值不为空且值为数值且值要大于等于1if (NumberUtil.isNumber(monthNum) NumberUtil.parseInt(monthNum) 1) {apiService.deleteByTime(monthNum);} else {logger.error(【apiService】其他的参数错误 monthNum{}, monthNum);}}Mapper !-- 小于等于 --delete iddeleteByTimedelete from table_name where create_time lt; DATE_SUB(NOW(), INTERVAL #{monthNum} MONTH)/delete
http://www.yutouwan.com/news/315125/

相关文章:

  • 北京个人网站建设多少钱湖南郴州市有几个县
  • 江阴做公司网站有哪些群晖个人网站建设
  • 柬埔寨网站建设推进门户网站建设方案
  • 网站备案需要的资料四网合一的网站
  • 装修设计公司网站排名做的好点的外贸网站有哪些
  • 网站优化页面沈阳城乡建设局官网
  • 网站设计集团购买主机可以做网站吗
  • 网站变成灰色外包公司做网站图片哪里整的
  • 新乡网站优化杭州十大跨境电商排名
  • 美空间网站大气学校网站模板
  • 网站建设要实现的目标wordpress 重写分页
  • 西安做网站的公司有哪些开网页多对什么要求高
  • 网站代运营费用软件开发税率是13%还是6
  • 交易网站开发文档网站推广码怎么做
  • 自助建站平台哪家好泰安建设网站公司
  • 电子产品网站模板淘宝上网站建设为啥这么便宜
  • 中国门户网站南宁网站建设超薄网络
  • 本溪网站开发公司怎么获取网站ftp地址
  • 重庆綦江网站建设宁波网站建设模板下载
  • 网站修改 iis6应用程序池做动漫姓氏头像的网站
  • 如何做电商网站视频广州网络维护
  • 装修企业网站建设开个做网站的公司
  • 2018年深圳建设网站公司做暖暖视频网站大全
  • wordpress模板导航类股票发行ipo和seo是什么意思
  • 无为建设局网站python教程
  • 麒贺丝网做的网站优化优化的定义
  • 做网站公司 上海大公司网站建设
  • 怎么在手机上做企业网站手机赚钱平台正规
  • 网站开发合同缺陷网站建设大神级公司
  • 做网站开发需要什么证书海南做网站公司哪家好