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

9 lines
157 B
Bash
Raw Normal View History

#!/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"