Community
    • Categories
    • Recent
    • Popular
    • Users
    • Search
    • Register
    • Login

    Periodic LDAP-Sync with Cron

    Scheduled Pinned Locked Moved General
    2 Posts 2 Posters 514 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Q Offline
      QuimaxW
      last edited by QuimaxW

      This may be a newb question, but I want to ask anyways.

      The knowledgebase walks through ldap sync and getting that connection working. That's fine. It's working.

      Using the example command:

      sudo -u www-data php console.php ldap-sync --user admin --password admin --tenantId 1 --verbose --ldapServerId 1
      

      Everything syncs fine.

      To do this periodically, it needs to go into cron.

      Do I just put the above command into /etc/cron.d/i-doit ? Like this?

      5 5 * * *   www-data    test -x /usr/local/bin/idoit-jobs && /usr/bin/chronic /usr/local/bin/idoit-jobs
      4 5 * * * www-data php console.php ldap-sync --user admin --password admin --tenantId 1 --verbose --ldapServerId 1
      

      Or is there another better way to do that or to put the command so that it will sync ldap on a regular basis?

      MartinVM 1 Reply Last reply Reply Quote 0
      • MartinVM Offline
        MartinV @QuimaxW
        last edited by

        We simply added the ldap-sync call to the list of jobs in /usr/local/bin/idoit-jobs, e.g. in the function execute

        log "LDAP sync"
        eval "${prefix}${CONSOLE_BIN} ldap-sync --verbose --ldapServerId=1 $suffix" || \
                abort "Command 'ldap-sync' failed"
        

        The missing parameters to ldap-sync in the aboce command are taken from the $suffix variable.

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post