1 |
jcrisp |
1.1 |
diff -ruN smeserver-dirty-tools-0.1.0.old/root/sbin/e-smith/dt-dovecot-indexfiles-delete smeserver-dirty-tools-0.1.0/root/sbin/e-smith/dt-dovecot-indexfiles-delete |
2 |
|
|
--- smeserver-dirty-tools-0.1.0.old/root/sbin/e-smith/dt-dovecot-indexfiles-delete 2021-06-04 14:43:39.000000000 +0100 |
3 |
|
|
+++ smeserver-dirty-tools-0.1.0/root/sbin/e-smith/dt-dovecot-indexfiles-delete 2021-11-11 15:03:18.383879108 +0000 |
4 |
|
|
@@ -7,12 +7,17 @@ |
5 |
|
|
|
6 |
|
|
echo "Deleting Dovecot's index files"; |
7 |
|
|
|
8 |
|
|
-USERS=`/usr/bin/find /home/e-smith/files/users -type d -maxdepth 1` # users |
9 |
|
|
+# Find users - also finds /home/e-smith/files/users |
10 |
|
|
+USERS=`/usr/bin/find /home/e-smith/files/users -maxdepth 1 -type d` |
11 |
|
|
+ |
12 |
|
|
+# Add Admin dir |
13 |
|
|
USERS="/home/e-smith/ $USERS" # admin |
14 |
|
|
+ |
15 |
|
|
for u in $USERS; do |
16 |
|
|
+# Ignore dirs without Maildir |
17 |
|
|
! /usr/bin/test -d $u/Maildir && continue |
18 |
|
|
/usr/bin/find $u/Maildir -maxdepth 2 -type f -name "dovecot.index*" -exec /bin/rm -f '{}' \; |
19 |
|
|
/usr/bin/find $u/Maildir -maxdepth 2 -type f -name ".imap.index*" -exec /bin/rm -f '{}' \; |
20 |
|
|
done |
21 |
|
|
|
22 |
|
|
- |
23 |
|
|
+echo "Completed"; |