diff options
Diffstat (limited to 'colmena/cobalt')
-rw-r--r-- | colmena/cobalt/services/gitolite.nix | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/colmena/cobalt/services/gitolite.nix b/colmena/cobalt/services/gitolite.nix index 4461a30..459a80e 100644 --- a/colmena/cobalt/services/gitolite.nix +++ b/colmena/cobalt/services/gitolite.nix @@ -52,14 +52,17 @@ age=$(( $system_timestamp - $trash_timestamp )) # Wipe trashes older than 2w if [[ age -gt 1209600 ]] ; then - target_dir=$(rev <<< $dir | cut -d'/' -f2- | rev) - echo "Removing '$target_dir' (age $age)" - rm -rf $target_dir + echo "Removing '$dir' (age $age)" + rm -rf $dir ((removed_entry+=1)) fi ((processed_entry+=1)) done + echo "Directories that needs cleanup:" + find Trash -type d -empty -print -delete + echo "Cleaned empty directories." + echo "Done! Removed $removed_entry/$processed_entry" ''; |