From: Tim R. <ti...@ph...> - 2011-03-05 08:19:16
|
Hi, 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 /usr/local/bin/archivemail --delete --days=30 --include-flagged --preserve-unread /usr/boxes/gordonfe/asia-pacific-superyachts.com/pobox3 sleep 60 /usr/local/bin/archivemail --delete --days=30 --include-flagged --preserve-unread /usr/boxes/gordonfe/asia-pacific-superyachts.com/pobox4 sleep 60 /usr/local/bin/archivemail --delete --days=30 --include-flagged --preserve-unread /usr/boxes/gordonfe/asia-pacific-superyachts.com/pobox5 sleep 60 /usr/local/bin/archivemail --delete --days=30 --include-flagged --preserve-unread /usr/boxes/gordonfe/asia-pacific-superyachts.com/pobox7 sleep 60 # Bali /usr/local/bin/archivemail --delete --days=30 --include-flagged --preserve-unread /usr/boxes/gordonfe/asia-pacific-superyachts.com/pobox14 sleep 60 /usr/local/bin/archivemail --delete --days=30 --include-flagged --preserve-unread /usr/boxes/gordonfe/asia-pacific-superyachts.com/pobox15 sleep 60 /usr/local/bin/archivemail --delete --days=30 --include-flagged --preserve-unread /usr/boxes/gordonfe/asia-pacific-superyachts.com/pobox16 sleep 60 /usr/local/bin/archivemail --delete --days=30 --include-flagged --preserve-unread /usr/boxes/gordonfe/asia-pacific-superyachts.com/pobox17 sleep 60 /usr/local/bin/archivemail --delete --days=30 --include-flagged --preserve-unread /usr/boxes/gordonfe/asia-pacific-superyachts.com/pobox18 sleep 60 /usr/local/bin/archivemail --delete --days=30 --include-flagged --preserve-unread /usr/boxes/gordonfe/asia-pacific-superyachts.com/pobox19 sleep 60 /usr/local/bin/archivemail --delete --days=30 --include-flagged --preserve-unread /usr/boxes/gordonfe/asia-pacific-superyachts.com/pobox20 -- Tim Rice Computer Stuff Phuket, Thailand http://www.phuket-mail.com http://www.computerstuff.net |
From: Nikolaus S. <mic...@we...> - 2011-03-07 21:14:54
|
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 |
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 |
From: Tim R. <ti...@ph...> - 2011-03-08 05:36:10
|
Hi Nikolaus, How exactly should I do that? I used the * after the mailbox directory and got the following errors at the end. IE /usr/boxes/gordonfe/asia-pacific-superyachts.com/* /usr/boxes/gordonfe/asia-pacific-superyachts.com/pobox41: deleted 0 of 615 message(s) (0B of 60.3MB) in 11.0 seconds /usr/boxes/gordonfe/asia-pacific-superyachts.com/pobox41^: deleted 0 of 0 message(s) (0B of 0B) in 0.0 seconds Traceback (most recent call last): File "/usr/local/bin/archivemail", line 1604, in <module> main() File "/usr/local/bin/archivemail", line 703, in main archive(mailbox_path) File "/usr/local/bin/archivemail", line 1149, in archive _archive_mbox(mailbox_name, final_archive_name) File "/usr/local/bin/archivemail", line 1220, in _archive_mbox retain.write(msg) File "/usr/local/bin/archivemail", line 384, in write self.mbox_file.write(body) IOError: [Errno 28] No space left on device On Tue, Mar 8, 2011 at 3:45 AM, Nikolaus Schulz <mic...@we...> 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 > -- Tim Rice Computer Stuff Phuket, Thailand http://www.phuket-mail.com http://www.computerstuff.net |