 path          = require 'path'
 
 module.exports = (agent, mqtt, config) ->
-  publishStorageBuckets = (err, buckets) ->
-    mqtt.publish '/agent/storage/buckets', buckets unless err
-
   publishDataStoreUsage = (dir) -> ->
     exec "df -B1 #{dir} | tail -1 | awk '{ print $2 }{ print $3}{ print $5}'", (err, stdout, stderr) ->
       if err

        total: totalSize
        used: usedSize
        percentage: percentage

  listStorageBuckets = (dir, cb) ->
    fs.readdir dir, (err, dirList) ->

        catch ex
          cb? ex, null


  basePath = path.join config.dataDir, config.domain

  listStorageBuckets basePath, publishStorageBuckets
  fs.watch basePath, (eventType, filename) ->
