thanks for the help Conrad and Ralph! Hi Conrad:
On Tue 9/13/22 15:55 +0100 Conrad Hughes wrote: >> I have many nmh folders, that get filled by procmail. I'd like to >> have, an 'all' folder that is built by a shell script that could be >> called by cron daily. I'd be happy, with all msgs, say from the last >> 21 days. > >Install mairix. Then > > mairix d:21d- > >will fill your +s (or whatever you choose to call it) folder with >symlinks to emails from the last 21 days. It'll do a whole lot more >though since it's a general search engine. It can even index compressed >.mmdf archives: it's *great*. I had mairix installed; and I was doing that -- except that I did not have a script to easily update the list of all my folders. I now have something to update ~/.mairixrc with a list of "all" my folders. I use something like: find ~/Mail -mount -maxdepth 2 -type d -mtime -600 | perl -pe 's~^.*?/Mail/?~~' | sort # ... pipeline continues ending in a ":" join -------- Hi Ralph: On Tue 9/13/22 17:56 +0100 Ralph Corderoy wrote: >> I have many nmh folders, that get filled by procmail. I'd like to have, an >> 'all' >> folder that is built by a shell script that could be called by cron daily. >> I'd be happy, with all msgs, say from the last 21 days. Perhaps this script >> would remove bad symlinks in 'all' each time it runs. > >You're implying you want the ‘files’ in +all to be symlinks rather than >hard links? refile(1) can make hard links with -link. I would be ok with symlinks or hardlinks; but symlinks are better since I could quickly find which folder the msg first landed in. >I'd have thought useful parts would be: > > rmf +all > folder -create +all > > folder +foo && pick -list -after -21 | xargs -rd\\n refile -link +all > folder +bar && pick -list -after -21 | xargs -rd\\n refile -link +all OK, so I would have to walk through all the folders one by one and run pick. How about a soln something like rmf +all folder -create +all find ~/Mail -mtime -21 -type f -not -empty -regextype posix-egrep -regex '.*/[0-9]+$' |xargs _addmsgs2-nmh-all-folder sortm +all Could the script _addmsgs2-nmh-all-folder use refile? It seems refile does not create soft links. I got the soft link thing from mairx I think -- nice because I can find the orignal folder for the msg easily. If _addmsgs2-nmh-all-folder did not use refile, my hunch is I could "rmf +all;folder -create +all", then add symlinks in naming the first "1", etc; then nmh would magically fix .mh_sequences -- Right? When/how? Maybe sortm +all would repair .mh_sequences? > sortm +all > >If you want symlinks and you want to preserve +all from one run to the >next but remove the symlinks to files which are now too old whilst >adding those which are new then comm(1) would be handy. ok, thanks, I've used comm from time to time. I'm ok with clobbering/rebuilding all though. >> **In this way I could use sort and 'scan' to list the nmh 'all' folder >> msgs sorted by time.** > >One has wondered about the separation of email files into folders and >sequences, the overlap between the two, and most commands only working >within a single folder. Right. Maybe there should be a built in way to get at all msgs. -- thanks, Tom