only clean empty dirs 3 levels down from archive/work

This commit is contained in:
Jakobus Schürz 2020-01-23 13:35:09 +01:00
parent cf50d5bd30
commit a701b3f846

View file

@ -101,7 +101,7 @@ if [ $(id -u) -ne 0 ]; then
WORKDIR="${HOME}/Work"
# First cleanup all empty Archivdirectories for workdir
for i in $(find ${ARCHIVPATH} -type d |grep -v "$WDOTD" ); do
for i in $(find ${ARCHIVPATH} -maxdepth 3 -type d |grep -v "$WDOTD" ); do
if [ ! "$(ls -A $i)" ]; then
echo "DIR $i is empty -> remove it" >&2
rm -vr "$i" 2>&1 |tee -a ${MYSHELLCONFIG_LOGFILE} >&2