Re: Rebuilding SIS attachment links from log
4 Mar
2015
4 Mar
'15
6:26 a.m.
Well, with no guarantees or promises whatsoever...here's my first attempt. I'm certain someone else can come up with a much more robust solution but it's a starting point.
Since I typically see a batch of the error messages during an FTS update, my current usage is:
- doveadm fts rescan -u user-to-fix
- Perform a fts search to do a full mailbox scan
- Check the mail log to see the date/time of the errors (I usually have a window open with tail -f)
- Something like "grep 'Mar 3 20:17' mail.log > mail.err" gives me a starting point
execute dovesisfix and see if it helps.
-- Daniel
On 3/3/2015 1:08 PM, Daniel Miller wrote:
This seems simple enough...I'm just not script wizard. If someone can throw together a starting point I can test and tweak it from there.
It seems to me:
- Read /var/mail/mail.err or specified logfile
- For each "failed: read(/var/mail/attachments/aa/bb/attachmentHash-userHash" line, a. Confirm /var/mail/attachments/aa/bb/hashes/attachmentHash exists i. If attachmentHash is missing display such for possible backup searching. b. create link attachmentHash-userHash to hashes/attachmentHash
- Continue to end of file
Can this be done via "pure" BASH? Need sed/awk as well?
3581
Age (days ago)
3581
Last active (days ago)
0 comments
1 participants
participants (1)
-
Daniel Miller