mirror of
https://github.com/ovh/the-bastion.git
synced 2025-02-26 00:24:12 +08:00
fix: osh-remove-empty-folders: fix folders counting (logging only)
This commit is contained in:
parent
0ffdd108bd
commit
dc16e628e2
1 changed files with 2 additions and 2 deletions
|
@ -54,7 +54,7 @@ fi
|
|||
|
||||
# first, we list all the directories to get a count
|
||||
_log "Counting the number of directories before the cleanup..."
|
||||
nbdirs_before=$(find /home/ -mindepth 3 -maxdepth 3 -type d -mtime +$MTIME_DAYS -regextype egrep -regex '^/home/[^/]+/ttyrec/[0-9.]+$' -print | wc -l)
|
||||
nbdirs_before=$(find /home/ -mindepth 3 -maxdepth 3 -type d -regextype egrep -regex '^/home/[^/]+/ttyrec/[0-9.]+$' -print | wc -l)
|
||||
|
||||
_log "We have $nbdirs_before directories, removing empty ones..."
|
||||
# then we pass them all through rmdir, it'll just fail on non-empty ones.
|
||||
|
@ -63,7 +63,7 @@ find /home/ -mindepth 3 -maxdepth 3 -type d -mtime +$MTIME_DAYS -regextype egrep
|
|||
|
||||
# finally, see how many directories remain
|
||||
_log "Counting the number of directories after the cleanup..."
|
||||
nbdirs_after=$(find /home/ -mindepth 3 -maxdepth 3 -type d -mtime +$MTIME_DAYS -regextype egrep -regex '^/home/[^/]+/ttyrec/[0-9.]+$' -print | wc -l)
|
||||
nbdirs_after=$(find /home/ -mindepth 3 -maxdepth 3 -type d -regextype egrep -regex '^/home/[^/]+/ttyrec/[0-9.]+$' -print | wc -l)
|
||||
|
||||
_log "Finally deleted $((nbdirs_before - nbdirs_after)) directories in this run"
|
||||
|
||||
|
|
Loading…
Reference in a new issue