HT202657: OS X Server (Mountain Lion): Advanced configuration of the Caching service

Learn about OS X Server (Mountain Lion): Advanced configuration of the Caching service
dkilburn2

Q: Is there a way to obtain a list of all of the apps / updates that are cached to your server?

Is there a way to obtain a list of all of the apps / updates that are cached to your server?  Of course we can see the space that each category is taking up.  But I'd like a detailed list of the individual items that are actually cached.

Itd be even better if I could get a dashboard that showed me how many times a particular item was served to clients.

Mac Pro, OS X El Capitan (10.11.3)

Posted on Feb 29, 2016 5:14 AM

Close

Q: Is there a way to obtain a list of all of the apps / updates that are cached to your server?

  • All replies
  • Helpful answers

  • by Strontium90,

    Strontium90 Strontium90 Feb 29, 2016 6:32 AM in response to dkilburn2
    Level 5 (4,067 points)
    Servers Enterprise
    Feb 29, 2016 6:32 AM in response to dkilburn2

    Yes.  But you need a little Terminal magic to get at the data you want.  Caching Server is managed by an sqlite database.  To examine the contents, follow these basic steps:

     

    1:  Connect to the database using the following command:


    sudo sqlite3 /Library/Server/Caching/Data/AssetInfo.db

     

    2:  To structure the data, run these two commands at the sqlite command prompt:


    .mode column

    .headers on


    3:  To find everything that is stored, run this command (you will get iCloud cached documents, books, iOS apps, etc.):

     

    select * from ZASSET;

     

    4:  To narrow the results down to items called by software updates, try this:

     

    select * from ZASSET where ZURI like "%content%";

     

    You might get a line that looks similar to the following:

     

    403         2           6           0           2012986793   474949928.477396  476912032.644505  e03448847909547fb8c7d4ecd5a7b6dd  FAB32A72-DE33-469D-A7DF-3CE1A1F9A4D2              Wed, 05 Aug 2015 18:00:30 GMT             

    /content/downloads/42/44/031-30888/bhrkylcnycxmtug9daw3g4magqb7dl7hba/OSXUpdComb o10.1

     

    (added line break for readability)

     

    This is an OS X Combo update.  It is located on disk at /Library/Server/Caching/Data/FAB32A72-DE33-469D-A7DF-3CE1A1F9A4D2/   The file is likely named 0 but if you want to use it, simply add .pkg at the end of the file.

     

    Hope this helps.  Caching server records a lot of data. 

     

    Oh, to exit sqlite command line tool, simply type .quit and hit return.

     

    Reid

    Apple Consultants Network

    Author - "El Capitan Server – Foundation Services"

    Author - "El Capitan Server – Control & Collaboration"

    Author - "El Capitan Server – Advanced Services"

    :: Exclusively available in Apple's iBooks Store

  • by dkilburn2,

    dkilburn2 dkilburn2 Mar 23, 2016 7:40 AM in response to Strontium90
    Level 1 (1 points)
    Mar 23, 2016 7:40 AM in response to Strontium90

    That did help, thank you.  Do you happen to know the filter I would use to narrow it down to IOS updates.  We're currently seeing over 600Gb of cached IOS updates and I wanted to make sure that the sevice is working properly and not storing the same update more than once. 

  • by Strontium90,

    Strontium90 Strontium90 Mar 23, 2016 5:20 PM in response to dkilburn2
    Level 5 (4,067 points)
    Servers Enterprise
    Mar 23, 2016 5:20 PM in response to dkilburn2

    How about:

     

    select * from ZASSET where ZURI like "%iOS%";

     

    Reid

    Apple Consultants Network

    Author - "El Capitan Server – Foundation Services"

    Author - "El Capitan Server – Control & Collaboration"

    Author - "El Capitan Server – Advanced Services"

    :: Exclusively available in Apple's iBooks Store

  • by dkilburn2,

    dkilburn2 dkilburn2 Mar 24, 2016 4:36 AM in response to Strontium90
    Level 1 (1 points)
    Mar 24, 2016 4:36 AM in response to Strontium90

    Thank you that's exactly what I needed.  So what we figured out was that because we have such a range of devices, there is technically a different update package per model... so even though we have 8 different lines that have the iOS9.3 beginning, it is caching each of them because each package is for a different model of the device.  There is currently 16 different models of the iPad, 15 of which support iOS 9.3 (not fully supported, but it can be installed on them).  Then there's the iPhone and iPod that each have their own number of models... so it just keeps expanding.

     

    You may already know all that, I'm still learning.  But I wanted to document it in case anyone else is looking for the answer and finds this thread.  Thanks again!

     

    Dave

  • by Michael Newbery,

    Michael Newbery Michael Newbery Mar 24, 2016 10:42 PM in response to Strontium90
    Level 4 (2,424 points)
    Servers Enterprise
    Mar 24, 2016 10:42 PM in response to Strontium90

    Thanks!

     

    If ever something called out for a GUI in Server though, this is it.

     

    One thing, if you have moved the location of your cache, you need to put that location in rather than /Library/Server/Caching/Data/AssetInfo.db (I was wondering why all my last modified dates were three years ago).

  • by dkilburn2,

    dkilburn2 dkilburn2 Mar 25, 2016 5:40 AM in response to Michael Newbery
    Level 1 (1 points)
    Mar 25, 2016 5:40 AM in response to Michael Newbery

    Is there a way to disable the caching of certain content.  I'm getting asked about disabling the iCloud content, while still having the iOS and Apps get cached.

  • by dkilburn2,

    dkilburn2 dkilburn2 Mar 25, 2016 6:04 AM in response to dkilburn2
    Level 1 (1 points)
    Mar 25, 2016 6:04 AM in response to dkilburn2

    And exactly what I asked for has been released in the new server update 5.1.  Nevermind