[How to] Clean your Mendix Project Directory and save many GBs on space
Running on a solid state drive, which is kinda required to run the Mendix Modeler, I don’t have much disk space. Though price of SSD are coming down, I have to deal with the little I have. Now, I have many project: Original, Branches, test project, Widgets project and back ups... counting to almost 200. It's time to organize and cleanup. Removing the projects is most effective, but I noticed that .svn and deployment directory are huge, and for archive not needed. Saving up to 50% disk space So I have created some good old time BAT files, to save some disk space, which I like to share with you. Of course: USE AT OWN RISK : D @echo off chdir "%CD%" for /f "delims=" %%D in ('dir /a:d /b') do IF EXIST "%%~fD/deployment/run" ( echo Removing: %%~nxD/deployment/run rmdir /s /q "%%~fD/deployment/run" ) for /f "delims=" %%D in ('dir /a:d /b') do IF EXIST "%%~fD/deployment/model" ( echo Removing: %%~nxD/deployment/model rmdir /s /q "%%~fD/deployment/model" ) for /f "delims=" %%D in ('dir /a:d /b') do IF EXIST "%%~fD/deployment/web" ( echo Removing %%~nxD/deployment/web rmdir /s /q "%%~fD/deployment/web" ) for /f "delims=" %%D in ('dir /a:d /b') do IF EXIST "%%~fD/deployment/log" ( echo Removing: %%~nxD/deployment/log rmdir /s /q "%%~fD/deployment/log" ) for /f "delims=" %%D in ('dir /a:d /b') do IF EXIST "%%~fD/deployment/felix-cache" ( echo Removing: %%~nxD/deployment/felix-cache rmdir /s /q "%%~fD/deployment/felix-cache" ) echo Cleaning completed pause How to use: Copy the content of the code into a bat file (let say CleanDeploymentDirs.bat) Save the bat file in your directory where all the projects are stored (so not in the project directory, but it’s parent.) Click the .bat file Wait.... and That’s it! Enjoy the your disk space! For the SVN batch cleanup: @echo off chdir "%CD%" set TORTOISE="C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" for /f "delims=" %%D in ('dir /a:d /b') do ( echo Cleaning %%~nxD IF EXIST "%%~fD/.svn" %TORTOISE% /command:cleanup /path:"%%~fD" /noui /nodlg /noprogressui /cleanup ) echo SVN clean batch Completed pause Make sure you have Tortoise SVN installed Check the install directory, and change in the bad file when needed. Create the .bat file in the folder containing your projects. Click the bat and run! Please let me know if have some improvements, or other script you like to share.