[cmd_du] Added function to check total projected disk usage of selected IMAGEIDs
This commit is contained in:
parent
72aac8134f
commit
ad853a61bf
2 changed files with 27 additions and 1 deletions
21
src/cmd_du
Normal file
21
src/cmd_du
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# doc cmd_du {
|
||||||
|
#
|
||||||
|
# DESCRIPTION
|
||||||
|
# cmd_du - Prints disk usage information like TOTAL USAGE of IMAGEID files on TARGET.
|
||||||
|
#
|
||||||
|
# USAGE
|
||||||
|
# cmd_du </path/to/git/dir> </path/to/target/dir>
|
||||||
|
#
|
||||||
|
# }
|
||||||
|
|
||||||
|
cmd_du() {
|
||||||
|
local GIT_DIR="${1}"
|
||||||
|
local TARGET="${2}"
|
||||||
|
local DB_FILE="${TARGET}/${_OPT_DB_FILE}"
|
||||||
|
|
||||||
|
local imageidList=($(awk 'BEGIN{FS="\t"}{if($1=="true"){print $2}}' ${DB_FILE} | awk '!seen[$0]++'))
|
||||||
|
local DU="$(print_imageid_du ${GIT_DIR} ${imageidList[@]})"
|
||||||
|
_msg ECHO "Current estimated disk usage: ${DU} bytes"
|
||||||
|
}
|
|
@ -23,6 +23,11 @@ case "${1}" in
|
||||||
update)
|
update)
|
||||||
shift
|
shift
|
||||||
cmd_update ${@}
|
cmd_update ${@}
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
du)
|
||||||
|
shift
|
||||||
|
cmd_du "${@}"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue