优化物理删除。
This commit is contained in:
parent
038747d236
commit
14a862e025
|
|
@ -44,8 +44,8 @@ public class ElePropertyConfig {
|
|||
private String backupMysqlScriptPath;
|
||||
|
||||
@Getter
|
||||
@Value("${tmp.file.store.days}")
|
||||
private int tmpFileStoreDays;
|
||||
@Value("${tmp.file.store.hour}")
|
||||
private int tmpFileStoreHour;
|
||||
|
||||
@Getter
|
||||
@Value("${backup.remote.host}")
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ public class BackupTask {
|
|||
|
||||
@Scheduled(cron = "0 0 3 * * ?")
|
||||
public void deleteTmpFile() {
|
||||
DateTime backDaysTime = DateUtil.offsetDay(new Date(), -elePropertyConfig.getTmpFileStoreDays());
|
||||
DateTime backDaysTime = DateUtil.offsetHour(new Date(), -elePropertyConfig.getTmpFileStoreHour());
|
||||
FileFilter filter = file -> file.lastModified() < backDaysTime.getTime();
|
||||
List<File> files = FileUtil.loopFiles(elePropertyConfig.getEleTmpPath(), filter);
|
||||
for (File file : files) {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ data.repo.upload.path=/szsd/data/eleData/dev/repo_upload/
|
|||
data.repo.download.path=/szsd/data/eleData/dev/repo_download/
|
||||
prj.folder.max.length=6
|
||||
# backupFiles
|
||||
tmp.file.store.days=7
|
||||
tmp.file.store.hour=48
|
||||
backup.remote.host=127.0.0.1
|
||||
backup.remote.port=1111
|
||||
backup.mysql.path=/workspace/mysqlbak/test
|
||||
|
|
|
|||
Loading…
Reference in New Issue