Jump to content
UBot Underground

Delete contents of a folder older than 60 minutes.


Recommended Posts

I have a folder that is constantly increasing in size (temp). I cant delete the temp files all at once as some are still needed and this causes ubot to crash. CCleaner is stuck at 24 hours so that isnt an option. I need something that i can run frequently and deletes files older than a specific amount of time.

 

Right now i just delete them once a day BUT that means all instances of ubot must not be running, giving me down time.

Link to post
Share on other sites

Right...at the moment you create the unique name, save it to a list or, like TJ said use the get files command to list all the files and delete them that way.

 

John

Link to post
Share on other sites

Right...at the moment you create the unique name, save it to a list or, like TJ said use the get files command to list all the files and delete them that way.

 

John

 

ubot automatically creates the temp file folder and does not removed it.

Link to post
Share on other sites

maybe my description was not clear.

 

i am runing multiple instances of ubot 24/7.

 

this means i CANT delete the temporary files that may be needed in the future (each bot has 10 loops).

 

In order to overcome this, i have to delete them if they are older than 60 minutes. I could probably get away with something that deletes if they are older than 6 hours.

 

I dont have control over what ubot saves as a temporary file nor can i tell what is saved; therefore i cant really code up anything and must use a dynamic script external of ubot.

Link to post
Share on other sites

if you can save the temp files to separate directories, maybe you could do something like call the $date function and parse out the current hour, then save the temp files to a directory named by that hour. then once in a while run a subroutine to figure out what the previous hour (or two hours ago) was, and delete the contents of that directory.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...