From: Jon C. <li...@jc...> - 2011-03-07 21:35:47
|
Nikolaus Schulz wrote: > On Sat, Mar 05, 2011 at 03:19:09PM +0700, Tim Rice wrote: > >> I'm new to Archivemail and I want to run Archiemail daily with a cronjob. I >> have it working but wondered if there is a better way to handle checking >> multiple accounts. >> >> I have over 150 poboxes I need to check. What I'm doing now is running this >> file via crontab. Is there a better way? >> >> # Phuket >> /usr/local/bin/archivemail --delete --days=30 --include-flagged >> --preserve-unread /usr/boxes/gordonfe/asia-pacific-superyachts.com/pobox1 >> sleep 60 >> /usr/local/bin/archivemail --delete --days=30 --include-flagged >> --preserve-unread /usr/boxes/gordonfe/asia-pacific-superyachts.com/pobox2 >> sleep 60 >> > > [...] > > You can simply list multiple mailboxes on the command line. > > Nikolaus > > ------------------------------------------------------------------------------ > What You Don't Know About Data Connectivity CAN Hurt You > This paper provides an overview of data connectivity, details > its effect on application quality, and explores various alternative > solutions. http://p.sf.net/sfu/progress-d2d > _______________________________________________ > archivemail-user mailing list > arc...@li... > https://lists.sourceforge.net/lists/listinfo/archivemail-user > I do this in PHP, but it could be done in Bash, Perl, Python, etc: <?php $dirs = array("Spam", "Trash", "Sent"); foreach($dirs as $dir){ $users = glob("/home/*"); foreach($users as $user){ $folder = $user . "/mail/" . $dir; if(file_exists($folder)){ $attrib = stat($folder); if($attrib[7]>0){ $bits = explode("/", $user); $uname = $bits[2]; system("su - " . $uname . " -c \"/usr/bin/archivemail --quiet --delete --days=14 " . $folder . "\""); }; }; }; }; ?> Copyright 2010 Me, consider it GPLv3+ if it makes you feel better. :) You could hack on this to make it way more configurable, you could make it run in parallel, etc. -J -- in your fear, seek only peace in your fear, seek only love -d. bowie |