Apple Software Update Server - How do I get rid of old updates?

Kevin
Contributor II

Not directly JAMF related, but am hoping you guys can help.

I have my SUS setup to copy all updates from Apple and I have "Delete outdated software updates" checked. I have updates from Lion, Snow Leopard, Leopard and Tiger in there - going back to 4/12/05. We only use Lion and Snow Leopard in our organization. The volume housing my SUS files has run out of space. If I could dump the Leopard and Tiger updates I would have plenty of room until my server is budgeted for replacement this Fall.

My question is: How do I get rid of the old stuff and prevent it from re-downloading?

8 REPLIES 8

mm2270
Legendary Contributor III

Apple has an old article that may still work on more recent versions of Software Update Server on how to do this. We don't delete any of our updates, so I have not done this before. I'm not sure if the instructions are still relevant, but take a look-

http://support.apple.com/kb/TA23656?viewlocale=en_US&locale=en_US

rockpapergoat
Contributor III

if you're on a recent version of os x server, see if the options for swupd_syncd give you what you want.

swupd_syncd 10.6.97 (97.4) for Mac OS X Server 10.6 (Darwin/x86_64) 

USAGE

  swupd_syncd -h
  swupd_syncd [ -ver | -appleversion ]
  swupd_syncd -sync
  swupd_syncd -showDeprecated
  swupd_syncd -removeDeprecated
  swupd_syncd -recoverPurged
  swupd_syncd -checkRequests
  swupd_syncd -listCatalogs
  swupd_syncd [ -disable | -enable | -mirror ] <PRODUCT>

OPTIONS

  -h      displays this message
          (may not be combined with other options)

  -ver    displays program version information

  -sync   force refresh of local content from master software update server.
          (This is the default action if no arguments are given.)

  -showDeprecated
          displays a list of all deprecated software products

  -removeDeprecated
          delete all deprecated software products from the catalog

  -recoverPurged
          restore lost catalog items from downloaded files

  -checkRequests
          process pending service admin requests.

  -listCatalogs
          display all known product catalog URLs.

  -disable <PRODUCT>
  -enable  <PRODUCT>
  -mirror  <PRODUCT>
          perform the requested action for the selected product,
          where PRODUCT is an product indentifier (e.g. 061-2345)

RETURNS

    On exit, the process returns 0 if no errors or -1 if the sync operation failed [1]

NOTES

  [1] If the program returns errors, consult the swupd_syncd log file
      (/var/log/swupd/swupd_sync_log) for more details.

  [2] Additional debug logging can be enabled with the following command:
          sudo defaults write /Library/Preferences/com.apple.SUServer enableDebugLogging -bool [ yes | no ]
          (default: debug log message are disabled)

      Detailed sources for any log message can be enabled with the following command:
          sudo defaults write /Library/Preferences/com.apple.SUServer showLogSource -bool [ yes | no ]
          (default: source information is disabled)

Kevin
Contributor II

Tried swupd_syncd -removeDeprecated.

No luck.

Of course, Apple SUS is so globally messed up right now, who knows…

rockpapergoat
Contributor III

i suppose you could "cheat" and use reposado's repoutil to clean up/purge your storage. but then, if you were to do that, you'd be better off using it and not apple's sus. you could try pointing the reposado prefs to the swupd store, then see if you can clean it up with repoutil.

mm2270
Legendary Contributor III

Another option is to script the removal of the updates on your Apple SUS.
If you do a 'swupd_syncd -showDeprecated' do you get a huge list of updates that it states can be safely removed? I do on mine. A huge list, which I was surprised about. I didn't realize there were so many deprecated updates still sitting on there.

I hacked this together in like 2 minutes, so please don't take my word for it that this will work. I haven't tested it and don't plan to since we don't need to remove the deprecated updates at this time. Its just an idea of how you may be able to use the info that command provides. Do your own testing and be careful with any deletion from the command line.

#!/bin/sh

List=`swupd_syncd -showDeprecated | awk -F"path " '{print $2}' | awk -F" as" '{print $1}'`

for i in $List; do
    sudo rm -R $i
done

Again, usual warnings apply here as you're doing an 'rm -R', so be super careful with this.

GabeShack
Valued Contributor III

sudo swupd_syncd -removeDeprecated
worked great on 10.9.3 server. Thanks!

Gabe Shackney
Princeton Public Schools

Gabe Shackney
Princeton Public Schools

dstranathan
Valued Contributor II

Thanks. Good info.

Matt_Ellis
Contributor II

Gabe, thank you for that it just worked great on my sus server

OS X 10.10.5 Server App 5.0.4