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