Hey guys,

    Here's a script I thought some of you might find useful.  Just download
    it, edit a couple variables (pretty self-explantory when you look at the
    names and default values), and slap it in a cron job or something.

    In a nutshell, the script reads /etc/cyrus_ldap_quota_time to get a
    general time entry.  This is the last time the script was run.  It then
    does an ldapsearch with a modifyTimestamp >= to that value read in to
    update all entries that have changed since then.

    It's very kludgy code.  I decided to run an ldapsearch via backticks so
    that people wouldn't need to get an LDAP Perl module.  Pretty ugly, but
    it works well.

    The file also needs to be run with sufficient privs to write to the file
    /etc/cyrus_ldap_quota_time.

    Also, the first time this script is run, that file doesn't exist
    obviously.  Don't worry, it takes care of that.

    And the output is ugly if there aren't any entries to be updated.
    Anyone who cares to fix it, be my guest :)  It won't hurt anything, but
    it'll spit some stuff out to the console.  Try it to see what I mean.

    As usual, questions/complaints/praise/whatever, just email me.

    This is my temporary solution until I hack the source code to add native
    LDAP quota look ups.  But maybe people who can't afford to take their
    servers down will find it more helpful.

    Special thanks for the new mail archive system, which allowed me to find
    help on similar topics quicker :)

-- 
 Kevin

cyrus_ldap_quota.pl

Reply via email to