diff options
author | Jonas Smedegaard <dr@jones.dk> | 2021-09-28 16:27:15 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2021-09-28 16:27:15 +0200 |
commit | 3d6dabbf2dbf0d145b101e2eb8d6fac53246caf5 (patch) | |
tree | 0135e93806dfa1e06fe346eae2bd41ddfec25e37 /localrmstaleaccounts | |
parent | 598d5307bbe5cf20f45780cd8ef1fb40c9694fe9 (diff) |
be verbose about actual removals
Diffstat (limited to 'localrmstaleaccounts')
-rwxr-xr-x | localrmstaleaccounts | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/localrmstaleaccounts b/localrmstaleaccounts index c7ceaae..137dd61 100755 --- a/localrmstaleaccounts +++ b/localrmstaleaccounts @@ -53,7 +53,8 @@ info() { } remove_account() { - [ -n "$DRY_RUN" ] || localrmaccount "$1" + warn "$2" + [ -n "$DRY_RUN" ] || localrmaccount "$1" "$2" } for user in "$@"; do @@ -65,14 +66,11 @@ for user in "$@"; do elif [ ! -d "$home/Maildir" ]; then warn "Skipping user $user: Missing Maildir" elif find "$home/Maildir/new" -maxdepth 0 -type d -mtime +365 | grep -q .; then - info "Removing user $user: Maildir INBOX/new untouched for a year" - remove_account "$user" + remove_account "$user" "Removing user $user: Maildir INBOX/new untouched for a year" elif find "$home/Maildir/cur" -maxdepth 0 -type d -mtime +365 | grep -q .; then - info "Removing user $user: Maildir INBOX/cur untouched for a year" - remove_account "$user" + remove_account "$user" "Removing user $user: Maildir INBOX/cur untouched for a year" elif find "$home/Maildir/new" -type f -mtime +365 | grep -q .; then - info "Removing user $user: new mail in INBOX untouched for a year" - remove_account "$user" + remove_account "$user" "Removing user $user: new mail in INBOX untouched for a year" else info "Skipping user $user" fi |