Scheduler for deleting physical files based on Mon

2019-08-27 08:06发布

问题:

I am trying to implement a scheduler which will run every 24 hours for my java application. The scheduler is associated with Mongo DB records. I would like to delete the files which are named exactly same as the ID of Mongo DB auto deleted documents. I think scanning the whole documents of a collection and cross checking with the file names would not be the good solution.

What is the best way to do? I have tried using the logs of profiler but, It is not storing the auto deleted records.

回答1:

Go for quartz scheduler. Check http://www.mkyong.com/tutorials/quartz-scheduler-tutorial/