diff --git a/src/scripts/du.sh b/src/scripts/du.sh index 6cd24c9e9..d159b9374 100755 --- a/src/scripts/du.sh +++ b/src/scripts/du.sh @@ -18,12 +18,6 @@ if [[ "$1" == "--check" ]]; then fi path="$1" -exclude="${2:-}" # -B1 makes du print block sizes and not apparent sizes (to match df which also uses block sizes) -if [[ -z "${exclude}" ]]; then - du -DsB1 "${path}" -else - du -DsB1 "${path}" --exclude "${exclude}" -fi - +du -DsB1 "${path}" diff --git a/src/system.js b/src/system.js index db8a21f5a..b709dc9e3 100644 --- a/src/system.js +++ b/src/system.js @@ -27,11 +27,10 @@ const apps = require('./apps.js'), const DU_CMD = path.join(__dirname, 'scripts/du.sh'); -async function du(file, options) { +async function du(file) { assert.strictEqual(typeof file, 'string'); - assert.strictEqual(typeof options, 'object'); - const [error, stdoutResult] = await safe(shell.promises.sudo('system', [ DU_CMD, file, options.exclude || '' ], {})); + const [error, stdoutResult] = await safe(shell.promises.sudo('system', [ DU_CMD, file ], {})); if (error) throw new BoxError(BoxError.FS_ERROR, error); return parseInt(stdoutResult.trim(), 10); @@ -61,7 +60,7 @@ async function getDisks() { const standardPaths = [ { type: 'standard', id: 'platformdata', path: paths.PLATFORM_DATA_DIR }, - { type: 'standard', id: 'boxdata', path: paths.BOX_DATA_DIR, exclude: 'mail' }, + { type: 'standard', id: 'boxdata', path: paths.BOX_DATA_DIR }, { type: 'standard', id: 'maildata', path: paths.MAIL_DATA_DIR }, ]; @@ -171,7 +170,7 @@ async function updateDiskUsage(progressCallback) { if (content.id === 'docker') { content.usage = (await docker.df()).LayersSize; } else { - content.usage = await du(content.path, { exclude: content.exclude }); + content.usage = await du(content.path); } progressCallback({ message: `du of ${JSON.stringify(content)}: ${content.usage}`}); }