Home > front end >  Deleting files in the background service
Deleting files in the background service

Time:01-14

I need to delete files in the background service after a certain time, is it possible to implement this and in what way?

CodePudding user response:

You can try WorkManager. It will delete your file...

CodePudding user response:

Question is pretty vague. Please be specific on which OS you want to this, any specific technology, particular environment... queue of questions on your questions i so endless.

Though to answer at high level:
Solution 1: If windows / Linux, you can write a batch / shell script which you can mark into Windows scheduler / Linux cron job. Batch will have all logic to what to delete from which path, any specific file or starting with etc. scheduler / cron job will decide at what time you want to do this. For this timeline you need to check syntax and for both OS its different. Simple search and you will get everything.
Solution 2: If you want o do it by code, you can write a Spring scheduler code (this can be in any language, but as Java developer, I will prefer this) which will interact with file system and perform file deletion for you after particular interval. For this you may need an application server to deploy.

If application server is available on machine then this will be easy job for you, or else easiest thing to do is Solution 1.

  •  Tags:  
  • Related