Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-06-2009, 09:17 AM
Trained Alumni
 
Posts: 12
Default Cron job to get members of ALL distribution lists

Does anybody have an example/advice of using zmprov to get a daily dump of ALL distribution lists with their members?

We'd like to get a daily dump of this to keep our internal records wiki up to date.

I've gotten as far as using 'zmprov gadl > lists.txt' to get the distribution lists, but am stuck at finding a way to list all of the lists members (in one output file, in an automated manner.)
Reply With Quote
  #2 (permalink)  
Old 07-06-2009, 10:24 AM
Outstanding Member
 
Posts: 594
Default

something like :-

for i in `cat lists.txt`
do
zmprov gdlm $i
done
Reply With Quote
  #3 (permalink)  
Old 07-06-2009, 03:39 PM
Trained Alumni
 
Posts: 12
Default

Wound up with this today. (First shell script I've ever made, probably lots wrong with it, but it seems to work.)

Code:
#!/bin/sh
PATH=/opt/zimbra/bin:/opt/zimbra/zimbramon:/opt/zimbra/postfix/sbin:/opt/zimbra/openldap/bin:/opt/zimbra/snmp/bin:/opt/zimbra/sleepycat/bin:/opt/zimbra/openssl/bin:/opt/zimbra/java/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin; export PATH
cd /tmp/distrolists
sleep 10
zmprov gadl > lists.txt
sleep 10
sed -e 's/^/gdl /' < lists.txt > lists2.txt
sleep 10
zmprov -f lists2.txt > lists3.txt

Last edited by sanford; 07-06-2009 at 08:33 PM.. Reason: spelling error
Reply With Quote
  #4 (permalink)  
Old 07-06-2009, 08:29 PM
Outstanding Member
 
Posts: 594
Default

Good to hear it works for you.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.