How to DELETE old packages?
After using PDQ for quite a while, I'm starting to amass many packages from their repository. Unfortunately, I have about 5GB of space available right now (it was installed by the tech before me to the LOCAL HARD DRIVE... Groan). I know I can move it off to a server, but I don't want to offload 12GB of installed to a server right now.
My feature request is that when you remove a package, it also removes the install file, if it was downloaded via the PDQ Repository.
16
Comments
I am also interested in this, I have only just noticed that all the old versions I thought I had deleted still have files in the repository folder. An option to delete the files from the repository when removing the package from the software would be good.
Another +1 to this request. This is exactly what I came to the forums to make a post on this morning.
Another +1 to this request.. I had always assumed that deleting a package also deleted the files associated with it in the repository. Recently setup another DFS target and was quite surprised when I checked the folder size to figure out how long it would take to sync for the first time. I ended up manually cleaning it out.
It would be very helpful if PDQDeploy would delete the files associated with a package when the package is removed.
This seem like a basic feature that is left out for some reason.
The very nature of a deployment application will over time generate many install files.
So when you delete a package you should be prompted if you want to delete the corresponding file(s) or not. Or maybe a setting where that is done by default, at least on the packages that originates from the package library… (you can just download again if you deleted by mistake).
Or a cleanup tool, that delete all files on the $(Repository) that no longer has a package in PDQ Deploy GUI.
Problem right now is that if you delete a package (that you have downloaded from the package library) the files will stay there forever.
What surprised me more, when auto deploy was released… even they are not cleaned up. That’s just not understandable. Because you can not redeploy the old versions yourself, because there are no GUI for that. The files reside on the repository and there are references to the files in the database, but it is not visible in GUI.
Yesterday I was working on a tool that was supposed to clean up all the unused files in $(Repository). Logic was:
- Kill PDQDeploy Console and stop the service
- Rename Repository to RepositoryTemp
- Create an empty Repository folder
- Hook up to the DB, Loop threw the packages and copy back files and/or folders that are referenced in certain tables.
- At this point there should just be unused files and folders in RepositoryTemp
- Delete RepositoryTemp
- Start PDQDeploy service.
I run this and it did its job, but to my surprise, there were like 30 Chrome installations copied BACK to the repository that was going to be kept.
Reason for this is that Chrome was an auto deployment.
When you delete a regular package, regardless if you made it or it was downloaded from the library, it leaves the files alone, but at the very least, it deletes the records in the database.
That is not the case with auto deployment… so when a new version of chrome is out it just add the files to the repository and adds new records to the database. BUT it does not remove records of previous version, so it will be copied back, using my current logic.
Only way I can get around this it seems, is to delete all the Auto Deployment packages, and let PDQDeploy download them again when the next version is out.
I tried to trigger an auto deployment when the files was deleted manually (in hope of PDQDeploy to re-download the files when it did not find them) but it just failed, complaining it did not have the source files.
Hi guys,
This feature is something that we're definitely looking at adding in a future release but not sure what the timeline for implementing it is at the moment. Thanks for all the great ideas and use cases as we'll use those to help us plan the feature.
Jason
Thanx for the update Jason. Good too hear that you are looking at this.
If it's ok by AA I can attach the files to this thread if other users would like to do some repository cleanup, without manually identifying unused files and folders and delete them from the repository.
(I saved about 25 GB of data on the repository, after the cleanup.)
AA, gave the OK to post this little app.
Important note: Admin Arsenal does not support this in any way.
If you try it, and run into problems, you can post it here :)
There is a helpfile included in the .ZIP, read it.
I am using default paths, ran this on my Win 2008 Standard 64 bit (not R2) server with .NET installed and where Deploy and Inventory are installed and received this error:
Unhandled exception has occurred in your application. Could not find a part of the path.
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text ************** System.IO.DirectoryNotFoundException: Could not find a part of the path. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.Directory.InternalMove(String sourceDirName, String destDirName, Boolean checkHost) at PDQCleanUpRepository.CleanUpRepository.Rename_move_Repository() at PDQCleanUpRepository.CleanUpRepository.btnStartCleanup_Click(Object sender, EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies ************** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll ---------------------------------------- PDQCleanUpRepository Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///C:/Users/administrator.BCS/Desktop/PDQRepositoryCleaner/PDQCleanUpRepository.exe ---------------------------------------- System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34251 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System.Drawing Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34270 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34238 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Configuration Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- System.Xml Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34234 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- System.Data.SQLite Assembly Version: 1.0.91.0 Win32 Version: 1.0.91.0 CodeBase: file:///C:/Users/administrator.BCS/Desktop/PDQRepositoryCleaner/System.Data.SQLite.DLL ---------------------------------------- System.Data Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll ---------------------------------------- System.Transactions Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_64/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll ---------------------------------------- System.EnterpriseServices Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_64/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll ---------------------------------------- System.ServiceProcess Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.ServiceProcess/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.ServiceProcess.dll ----------------------------------------
************** JIT Debugging ************** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled.
For example:
<configuration> <system.windows.forms jitDebugging="true" /> </configuration>
When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.
Hi Don.
When does this happen?
Is it just after you execute the file?
If not do you use the paths to the Database, repository and TEMP repository?
The program is only tested with Windows 7 64bit and Server 2012R2. With .NET 4 installed.
I suspect is has something to do with access to the either the DB file or repository.
Read AND write access is needed to the repository path, because a temp directory is created under here.
Just for testing purpose you could try and give full control to everyone both to the db path, and repository..
You might also want to run the .exe as administrator (right click -> run as Administrator)
Sorry for the lack of error handling, but I have limited time for that L.. It did run fine on the systems tried it on.
It happens right away after clicking the green button. I'm running this locally on the Windows 2008 server where PDQ is installed, logged in as Administrator. I think it may have more than one version of .net installed but I'm sure one of them is 4.something.
Ok, if you get the GUI up, it probably have read the paths and created a temp directory.
To be sure, can you check if they are are all listed?
In the three first lines, there should be 3 paths.
And in the lower textbox it should also say:
"DB path fund
Repository path found"
And yes, the target framework for the application is .NET 4 (Not 4.5).
Sorry to not being able to assist much more.
I just hope you voted on this feature, so it will be handeled by PDQ Deploy in the future.
+1 please remove old installfiles!
its a mess to do this manually.
+1
+1 here as well
I adviced march 2014 to raise a question on deletion of deployements to remove the linked install files as well. Unfortunatly it did not make it to production so far.
I'm guessing they don't see their being a shortage in storage space for whatever is running PDQ Deploy. currently my main PDQ machine is running off of an SSD with only 256Gigs.
Looking at the Deployment folder it is over 5 Gigs, I am using 13 of their packages, some of the packages have 10 different versions downloaded and even both 32 and 64 bit versions.
I have good (great?) news. This feature will likely be included in the next release of PDQ Deploy. While it doesn't behave in the same fashion as the OP's feature request, it is a safe and sane way of cleaning up the repository easily.
too late for me, my license just expired, but good to hear.
Good to hear.
A bit disappointing that internal housekeeping was not in place from version 1.
So glad to hear this! I have a lot of cruft out there!
It appears that the Version 9 Release Notes have this as the top new feature... Looking forward to the update!
Downloaded the Update just a few moments ago and switched everything over to Version 9. The package cleanup mechanism is SLICK AS SHIT! Cleaned up 5GB of junk like.....literally 3 seconds. Top notch.
I just cleaned up 13GB!