From fdfa1577f33bdc5d15d302b2f951f25f48f3b9b4 Mon Sep 17 00:00:00 2001 From: akshay Date: Thu, 2 May 2024 18:53:03 +0530 Subject: [PATCH] Add cronjob authentik LDAP sync script --- authentik_install.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/authentik_install.sh b/authentik_install.sh index aa36d71..270c32e 100644 --- a/authentik_install.sh +++ b/authentik_install.sh @@ -38,3 +38,12 @@ fi ${SUDO} docker-compose pull ${SUDO} docker-compose up + +# Create cronjob to sync deleted users from LDAP +${SUDO} mkdir /usr/local/src/authentik_ldap_sync +${SUDO} cp authentik_deleted_user_sync.sh /usr/local/src/authentik_ldap_sync +if [ ! -f "/var/spool/cron/crontabs/root" ]; then + ${SUDO} echo "0 0 */7 * * /usr/local/src/authentik_ldap_sync/authentik_deleted_user_sync.sh" > /var/spool/cron/crontabs/root +else + ${SUDO} echo "0 0 */7 * * /usr/local/src/authentik_ldap_sync/authentik_deleted_user_sync.sh" >> /var/spool/cron/crontabs/root +fi