cancel
Showing results for 
Search instead for 
Did you mean: 

Running out of disk space

MaryCulotta
Level 3
What is the best practice to clear the logged in users temp folder. The VM are running out of disk space.

Thank you

------------------------------
Mary Culotta
------------------------------
8 REPLIES 8

ArikaJatwani
Level 2
Hi @Mary Culotta,

It is always advisable to reduce the number of logged in users in the VM. Do you have a huge list of users getting logged into your VMs?​

------------------------------
Arika Jatwani Process Manager
------------------------------

Hi Arika,

No we do not have a large number of users on the vm's.

------------------------------
Mary Culotta
------------------------------

PabloSarabia
Level 11
Hi!

Always is a good idea to have any housekeeping job for this kind of things.

In my company we defined a period time to delete old files, usually, files older than 3 months.

I think that, the best way is putting this job in an external scheduler, not in a BP Solution.

I give you some links speaking about cleaning up this kind of files:

https://www.lifewire.com/how-to-delete-temporary-files-in-windows-2624709
https://devblogs.microsoft.com/scripting/weekend-scripter-use-powershell-to-clean-out-temp-folders/


Hope this helps you!


Bye 🙂

------------------------------
Pablo Sarabia
Architect
Altamira Assets Management
Madrid
634726270
------------------------------

esaugos
Level 6
Hi @Mary Culotta,

Below Steps can be implemented in the ​Action Stages (Delete Files).

1. %temp% --> This cleans the temp files of the User Profile --> Username must be selected dynamically in a data item.
2.   temp --> This cleans the windows temp files. The RTR or VM must have admin rights to run this command.

Or, you can create a .bat script to add such commands and then execute using Start Process Action stage.

------------------------------
Saurabh Goswami
RPA Architect
Ericsson
------------------------------
Saurabh Goswami

HI Saurabh,

Can you elaborate a little more on how to accomplish what you are suggesting?

Thank you

------------------------------
Mary Culotta
------------------------------

Hi,

In my opinion, its really hard to make this only with the BP Tools and I do not recommend to put this kind of maintenance task inside a Business Process.

But... challenge accepted!

Attached to this message you have the full project that I made. Basically, import it (also need to have Utility - Collection Manipulation and Utility - File Management)

How its works? Just call the action "Housekeeping" from the object. You need to indicate the folder that you want to clean up and the number of days that you want to delete (If you put 180 its start deleting files older than Today()-180 days)

Its also delete files in subdirectories from the first path. If you open the Object you will find a page called "CleanUpFolder". In the last stage calls itself (recursively) to go inside every subfolders. (If you have some problems to understand this kind of recursive functions, tell me and I'll explain you better)

This is how the CleanUpFolder page looks like:
20486.png

My own recommendation for this problem...

Use this simple command line that you can launch from CMD

ForFiles /p "C:\My Folder" /s /d -30 /c "cmd /c del @file"

Only need to change the folder that you need and the days (C:\My Folder and -30 respectively)

If you create a .bat file, you can execute this from the Task Scheduler of Windows

It's faster, it's saver and it's better


Hope this helps you to fix your problem. And if this solves the issue, remember to mark this as the best answer 🙂


Bye 🙂

------------------------------
Pablo Sarabia
Architect
Altamira Assets Management
Madrid
634726270
------------------------------

​Hi Saurabh,

Can you explain a little more how I use the %temp%.

Thank you

------------------------------
Mary Culotta
------------------------------

Hi @Mary Culotta,

Sorry for the late response.. I was trying to explain as shown below for cleanup using %temp%.

Step-1: Get the Username
20487.png

Step-2: Delete files by giving %temp% file path. Sometimes this step requires admin access in the VM...to properly execute this step.
You can check the same by manually doing this step first... Admin access on the VM depends on the roles you have been provided by the Infra owner.


20488.png

------------------------------
Saurabh Goswami
RPA Architect
Ericsson
------------------------------
Saurabh Goswami