2023-01-18 16:43:21 -08:00
|
|
|
#!/bin/bash
|
|
|
|
# simple local copy wintin or merge one directory to another using rsync. Preserves everything
|
|
|
|
# present working directory to supplied destination
|
|
|
|
|
|
|
|
isDir() {
|
|
|
|
if [[ -d $1 ]]
|
|
|
|
then
|
|
|
|
echo "true"
|
|
|
|
return 0
|
|
|
|
else
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2024-02-12 12:53:25 -08:00
|
|
|
dir_size () {
|
|
|
|
if sudo ls $1 >/dev/null ; then
|
|
|
|
sudo du -h --apparent-size --max-depth=1 $1 | sort -rh
|
|
|
|
else
|
|
|
|
echo $1 not a directory
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# for dir in $(/bin/find -maxdepth 1 -name "*[cC]ache*" -type d ); do; echo $dir; done
|