I currently write a script for zimbra to get some informations from all accounts.
The script is realy small but takes forever because I can't find a good way to interact with zmprov
Code: Select all
# get all accounts
all_accounts=$(zmprov -l gaa)
echo "$all_accounts" > all_accounts.txt
for account in $all_accounts
do
zmprov ga "$account" > ${account}.cfg
done
# this takes about 5 seconds for every account
# for about 130 accounts this takes ~11 minutes :(
Like this:
Code: Select all
echo "ga user01@mydomain.com" >> zmprov_command.txt
echo "ga user02@mydomain.com" >> zmprov_command.txt
echo "ga user03@mydomain.com" >> zmprov_command.txt
echo "ga user04@mydomain.com" >> zmprov_command.txt
...
zmprov -f zmprov_command.txt > some_output_file.txt
# this takes about 15 seconds for ~130 accounts
# much faster
Also "getaccount (ga)" is not the only command I need (I also want the cos by name for every account, ...).
I also have tried a ldapsearch, this is fast but also not a good solution for the things I wan't to do.
Has someone an idea how I can speed things up here and don't lose the benefits of using single "zmprov" commands?
I can live with a patch solution but I need a good way to keep the output seperated.
keros