mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

commit d96948b50b1bf3940dc512d72e67aaece13cc825
parent 10a39202b2e85f2dcffc6ca1ecd6589efac09f63
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Fri, 16 Nov 2018 17:36:15 +0100

rm empty directories

Diffstat:
hierarchive | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/hierarchive b/hierarchive @@ -9,7 +9,12 @@ NDAYS="7" D=$(date '+%Y-%m-%d') F="$2/$D" -mkdir "$F" +#mkdir "$F" cd "$1" + +# find all old files and move them away find -type f -mtime +$NDAYS -print0 | xargs -r -0 -n 1 hierarchive_file "$F" +# now, recursively remove all empty directories +find . -type d | xargs rmdir -p 2>/dev/null +