This repository has been archived on 2023-09-23. You can view files and clone it, but cannot push or open issues or pull requests.
awesome-scripts/node_dir_size_exporter.sh
samuel-p f20f1349c5 added update-notify.sh
added node_dir_size_exporter.sh
2020-12-30 01:58:16 +01:00

8 lines
157 B
Bash

#!/bin/bash
DIR=$1
KEY=$2
FILE=$3
du -bsx $DIR | sed "s/\([0-9]*\).*\/\(.*\)/node_dir_size{name=\"\2\",key=\"$KEY\"} \1/" > "$FILE$$"
mv "$FILE$$" "$FILE"