Skip to content

Commit

Permalink
api: fix disk usage size (#39)
Browse files Browse the repository at this point in the history
The UI expects the size in bytes, while du outputs kilo-bytes by default.

NethServer/dev#6191
  • Loading branch information
gsanchietti committed Jun 4, 2020
1 parent a1fcf3a commit 2da4fdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/read
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ else
posts=$(_query "select count(*) from posts where deleteat = 0")

database_usage=$(su - postgres -c "scl enable rh-postgresql94 -- psql -q -A -t --port=55432 -c 'SELECT pg_database_size('\''mattermost'\'');'")
data_usage=$(/usr/bin/du -s /var/lib/nethserver/mattermost | cut -f1)
data_usage=$(/usr/bin/du -sb /var/lib/nethserver/mattermost | cut -f1)

prop=$(/sbin/e-smith/config getjson mattermost)
printf '{"status": { "users": "%s", "teams": "%s", "channels": "%s", "posts": "%s", "database-usage": "%s", "data-usage": "%s" },"configuration":%s}' "$users" "$teams" "$channels" "$posts" "$database_usage" "$data_usage" "$prop"
Expand Down

0 comments on commit 2da4fdb

Please sign in to comment.