Video Screencast Help

Issue: Old, Stale Packages Remain on Package Servers After They Have Been Removed from the Notification Server

Created: 20 Apr 2009 | 6 comments
dfrancis's picture
+10 10 Votes
Login to vote

When packages that have previously been replicated are removed from the Notification Server, these packages remain on the package server(s) despite them not being active, valid packages.  In environments where packages are retired or replaced with new packages frequently, this could cause an exorbitent amount of wasted space on package servers.

If you look at the Package Delivery folder on the package server (default C:\Program Files\Altiris\Altiris Agent\Package Delivery) and notice a variance in the number of folders compared to the Notification Server's reported packages, then this procedure should help increase available disk space on your package servers.

The below process can help you go from this...
imagebrowser image

to this...
imagebrowser image

Note: I am not a VBScripting guru. I've been able to utilize these scripts in our environment with little to no problems. Please carefully review and test these scripts before implementing in your production environment as I cannot be held responsible for any ill-effects these may cause.

Step 1: Identify which packages are still valid by deleting snapshot.xml files and refreshing packages

  • The first step is to identify which packages are still valid.
  • AKB 1492 discusses the topic of resynchronizing package servers with invalid or stale codebases. The steps outlined in section 2 of this KB will help you determine which packages are still valid.
  • There are two ways to accomplish this: manually or via a VBScript. The manual process is not ideal, especially in environments where there may be several package servers and when it comes to deleting old packages.
  • The attached VBScript (step1.vbs_.txt) does the following:
    -Reads the Altiris Agent installation folder from the registry
    -Creates a log file in the Package Delivery folder
    -Deletes all snapshot.xml files in the folders underneath the Package Delivery folder
    -Logs the instances of snapshot.xml that were deleted
    -Deletes the client policies from the Client Policies folder
    -Updates the client configuration
    -Refreshes the packages, which re-creates the snapshot.xml files
    -Logs the total number of snapshot.xml instances that were deleted
  • During the package refresh, if you were to log into the package server and look at the Package Server tab in the Altiris Agent GUI, you should see the number of available packages decrease as the downloading/pending packages increases. Then, the downloading/pending packages number will decrease and the available packages will increase as the snapshot.xml files are recreated. Once the downloading/pending packages number returns to 0 this step is complete.  Additionally, you can verify by searching the Package Delivery folder tree for snapshot.xml.  The end result should match the number of available packages in the Altiris GUI.

Step 2: Delete all packages which do not contain a snapshot.xml

  • After the snapshot.xml files have been recreated, it should be safe to delete any folder that does not contain a snapshot.xml, as this would be the indicator that it's a package the Notification Server has no knowledge of anymore.
  • Again, VBScript will come to the rescue by scanning through these folders and deleting any folder not containing the snapshot.xml file.  This only looks at the folders immediately under the Package Delivery folder, so you don't need to worry about the cache folders getting deleted.
  • The attached VBScript (step2.vbs_.txt) does the following:
       -Reads the Altiris Agent installation folder from the registry
       -Creates a log file in the Package Delivery folder
       -Steps through the Package Delivery folder's subfolders
       -Checks to see the presence of snapshot.xml in the subfolder
       -If the snapshot.xml files does not exist, the folder is deleted
       -Logs the folder name and disk space the folder used when it is deleted
       -Logs the total number of folders removed and total disk space freed when complete

These VBScripts could be manually executed, or could be scheduled through Software Delivery, Deployment Server, Windows Scheduled Tasks, or any other suitable means. You will just want to make sure that the Package Server has enough time to refresh packages before executing the second VBScript, as you may accidentally wind up deleting valid packages.

One issue I found is that if a site contains more than one package server, you do not want to run the snapshot refresh script on all of the package servers simultaneously. The package servers will continually try to re-download the missing snapshot.xml's from one another. To avoid this, it may be best to schedule these refreshes to occur at different days, or at least different times.

Comments 6 CommentsJump to latest comment

luisdg's picture

This is awesome!  I thought that package servers would be smart enough to clean themselves up since the client does, but apparently not.  We're going to implement this asap!


Login to vote
Eshwar's picture

thank you for sharing this with us.




Login to vote
KSchroeder's picture

Nice work!  I'm going to have to look at modifying this.  We replicate many of our packages to a destination folder on the PS (i.e. \\%COMPUTERNAME%\Software$\Vendor\Application\Version\) and this has the same problem of orphaned packages.  Also it is a good idea to go in and check the Package Server purging settings; you can set how long to keep deleted packages.  Maybe yours has been turned off, or you are also using a custom destination (which again prevents the package from being deleted).

Symantec Trusted Advisor

For Forum threads, please click "Mark as Solution" if answered.
For all content, please give a thumbs up if you agree with or support the post.

Login to vote
natemg's picture

I am currently on 7.5.  I am running out of space on my package servers, I do have them set to remove unused packages after 1 month but that doesn't seem to make a difference.   The other day I got rid of some large packages like old versions of office, however they remain on the package servers.   When I tried to run the above VBScripts each one fails.  The first one with a error at line 48 character 3 and the 2nd one at line 1 character 1.   Both look to my untrained eye to be fine.   Anyone have any ideas on how to get them to work? 

Login to vote
Chia Boon Yeong's picture

Hi the script u will need to deploy it from Altiris Console to the intended client machine in order for it to be works.

If you use try to run it with command prompt it will get run and return you with error code.

Login to vote