main
HuangHai 3 months ago
parent fce533abe7
commit f88f958eee

@ -1,30 +0,0 @@
package com.dsideal.base.clearRubbish;
import com.dsideal.base.Util.CommonUtil;
import com.jfinal.kit.LogKit;
import com.jfinal.kit.PathKit;
import com.jfinal.kit.PropKit;
import com.jfinal.plugin.activerecord.Db;
public class clearRubbishAction implements Runnable {
public void run() {
//1、清理excel的垃圾
String basePath = PathKit.getRootClassPath() + PropKit.get("ExcelImportTemplatePathSuffix").replace("\\", "/");
String tempPath = basePath + "excelTemp/";
CommonUtil.clearFile(tempPath);
basePath = PathKit.getRootClassPath() + PropKit.get("excelExportTemplatePathSuffix").replace("\\", "/");
tempPath = basePath + "excelTemp/";
CommonUtil.clearFile(tempPath);
LogKit.info("成功清除excel垃圾日志。");
//2、清理EXCEL导入数据表
String sql = "truncate table t_import_teacher_by_excel";
Db.update(sql);
sql = "truncate table t_import_student_by_excel";
Db.update(sql);
//3、以后扩展其它垃圾
}
}

@ -1,24 +0,0 @@
# cron 表达式由五部分组成:分 时 天 月 周 # 分 :从 0 到 59 # 时 :从 0 到 23 # 天 :从 1 到 31字母 L 可以表示月的最后一天 # 月 :从 1 到 12可以别名jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov" and "dec"
# 周 :从 0 到 60 表示周日6 表示周六,可以使用别名: "sun", "mon", "tue", "wed", "thu", "fri" and "sat"
#
# 数字 n表示一个具体的时间点例如 5 * * * * 表示 5 分这个时间点时执行
# 逗号 , :表示指定多个数值,例如 3,5 * * * * 表示 3 和 5 分这两个时间点执行
# 减号 -:表示范围,例如 1-3 * * * * 表示 1 分、2 分再到 3 分这三个时间点执行
# 星号 *:表示每一个时间点,例如 * * * * * 表示每分钟执行
# 除号 /:表示指定一个值的增加幅度。例如 n/m表示从 n 开始,每次增加 m 的时间点执行
# cron4j 集成cron 只有 分 时 天 月 周 没有秒
cron4j=clearRubbish,backup
# 每天凌晨2点执行一次
clearRubbish.cron=0 2 * * *
clearRubbish.class=com.dsideal.dsBase.clearRubbish.clearRubbishAction
clearRubbish.daemon=true
clearRubbish.enable=true
# 每天凌晨2点执行一次备份数据库
backup.cron=0 2 * * *
backup.class=Backup.BackupAll
backup.daemon=true
backup.enable=true
Loading…
Cancel
Save