Skip to content

Commit

Permalink
rearrange du commands
Browse files Browse the repository at this point in the history
This will allow the user to see why asd p command is taking too much
time as the directory sizes are being calculated at that point of time
  • Loading branch information
manorit2001 committed Sep 17, 2021
1 parent 5830999 commit a63a2e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/anything-sync-daemon.in
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,7 @@ parse() {
WORK="$VOLATILE/.asd-$USER$DIR"

# sync target dir size
psize=$(du -Dh --max-depth=0 "$DIR" 2>/dev/null | awk '{ print $1 }')
if [[ -d "$DIR" ]]; then
CRASHArr=( $(find "${BACKUP%/*}" -type d -name '*crashrecovery*' 2>/dev/null|sort -r) )
echo -en " ${BLD}owner/group id:"
echo -e $(tput cr)$(tput cuf 20) "$USER"/"$GROUP${NRM}"
echo -en " ${BLD}target to manage:"
Expand All @@ -460,13 +458,15 @@ parse() {
echo -en " ${BLD}tmpfs target:"
echo -e $(tput cr)$(tput cuf 20) "${RED}$TMP${NRM}"
echo -en " ${BLD}dir size:"
psize=$(du -Dh --max-depth=0 "$DIR" 2>/dev/null | awk '{ print $1 }')
echo -e "$(tput cr)$(tput cuf 20) $psize${NRM}"
if [[ $OLFS -eq 1 ]]; then
rwsize=$(du -Dh --max-depth=0 "$UPPER" 2>/dev/null | awk '{ print $1 }')
echo -en " ${BLD}overlayfs size:"
echo -e "$(tput cr)$(tput cuf 20) $rwsize${NRM}"
fi
echo -en " ${BLD}recovery dirs:"
CRASHArr=( $(find "${BACKUP%/*}" -type d -name '*crashrecovery*' 2>/dev/null|sort -r) )
if [[ "${#CRASHArr[@]}" -eq 0 ]]; then
echo -e "$(tput cr)$(tput cuf 20) none${NRM}"
else
Expand Down

0 comments on commit a63a2e4

Please sign in to comment.