Link to home
Start Free TrialLog in
Avatar of grjha
grjha

asked on

Run / Schedule a file deletion process everyday

My application is a java based application running in JBoss on Windows 2003 server. I need to ensure that the files (which are older than 30 days) in a particular folder are deleted everyday. This can be set to a particular time every day like midnight etc.

I do not want to use the Windows Scheduler to trigger this. What is the best way to ensure my application does this without the Windows Task Scheduler?
Avatar of Ajay-Singh
Ajay-Singh

SOLUTION
Avatar of RadioActiveLamb
RadioActiveLamb
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of grjha

ASKER

Ajay-Singh:
To use the time we will have to have background thread. As it is we have multiple threads being spawned in the application for some user specified process that should run in the background. So I would prefer some other way (if there is) rathet than have more thread(s) created. Is there another way to do this?

RadioActiveLamb:
Robocopy would be a third party tool to be used then. I guess that again will be an issue. Is there a good way to do it through Java?
Avatar of grjha

ASKER

Does the Windows Resource Kit come with default OS installation? Or is it something we would need to ensure to add or install before usage?
> So I would prefer some other way (if there is) rathet than have more
thread(s) created. Is there another way to do this?

Spawning a new thread has no harm, unless the thread is doing a lot context
switches. I don't think TimerTask does.
SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
:-)