if ($argc < 7) { echo "usage:\n"; echo "\tphp space.php <ignore-root> \"localhost\" - - - <usage-file> [expand-file] [--force]\n"; echo "\tphp space.php <ignore-root> <hostname> <port> <user> <key> <usage-file> [expand-file] [--force]\n"; die; } $ignore_root = intval($argv[1]); $hostname = $argv[2]; $usage_file = $argv[6]; $expand_directories = empty($argv[7]) ? array() : read_json_array($argv[7]); $force = isset($argv[8]) && $argv[8] === "--force"; if ($hostname != "localhost") { Executor::$host = $hostname; Executor::$port = is_numeric($argv[3]) ? intval($argv[3]) : 22; Executor::$user = $argv[4]; Executor::$key = $argv[5]; } $space = new Capacity(); $mounts1 = list_mounts("type ext"); $mounts2 = list_mounts("type fuse.mfs"); $mounts = array_merge($mounts1, $mounts2); asort($mounts); if (!$force) { $json = read_json_array($usage_file); $usage = $json["usage"]; $capacity = $json["capacity"]; } else { $usage = array(); $capacity = array(); } foreach ($mounts as $partition => $path) {