docker-openldap-backup icon indicating copy to clipboard operation
docker-openldap-backup copied to clipboard

backup doesn't work

Open crcjwice123 opened this issue 6 years ago • 7 comments

Since osixia/openldap-backup:1.2.3 is having some startup issue, I used 1.2.2 instead.

Here is my docker-compose.yaml. The two service works fine but ldap backup doesn't work. No matter what cron expression I used, the backup folder is always empty.

version: '2'

services: openldap: image: osixia/openldap-backup:1.2.2 command: --loglevel debug ports: - "389:389" - "636:636" volumes: - '/srv/ldap/database:/var/lib/ldap' - '/srv/ldap/config:/etc/ldap/slapd.d' - '/srv/ldap/backup:/data/backup' environment: - LDAP_ORGANISATION="riseye" - LDAP_DOMAIN=riseye.com - LDAP_ADMIN_PASSWORD=Initial0 - LDAP_BACKUP_CONFIG_CRON_EXP="0 0/5 0 ? * * *" - LDAP_BACKUP_DATA_CRON_EXP="0 0/5 0 ? * * *" networks: - test

phpldapadmin: image: osixia/phpldapadmin:0.7.2 ports: - "6443:443" environment: - PHPLDAPADMIN_LDAP_HOSTS=openldap networks: - test

networks: test: external: true

crcjwice123 avatar Feb 19 '19 03:02 crcjwice123

That's exactly my issue, too.

MiGoller avatar Apr 22 '19 11:04 MiGoller

Don't have this problem with my containers :s is this still an issue with v1.2.4 ?

BertrandGouny avatar May 28 '19 13:05 BertrandGouny

I have the same problem with 1.2.5:

docker run --env LDAP_ORGANISATION="local.dev" `
    --env LDAP_DOMAIN="somecompany.com" `
    --env LDAP_ADMIN_PASSWORD="JonSn0w" `
    --env LDAP_BACKUP_CONFIG_CRON_EXP="0/5 * * * *" `
    --env LDAP_BACKUP_DATA_CRON_EXP="2/5 * * * *" `
    -p 389:389 `
    --volume $PSScriptRoot/database:/var/lib/ldap `
    --volume $PSScriptRoot/config:/etc/ldap/slapd.d `
    --volume $PSScriptRoot/backup:/data/backup `
    osixia/openldap-backup:1.2.5

No backup files are written.

vidarkongsli avatar Aug 16 '19 09:08 vidarkongsli

I have the same problem with 1.2.5:

docker run --env LDAP_ORGANISATION="local.dev" `
    --env LDAP_DOMAIN="somecompany.com" `
    --env LDAP_ADMIN_PASSWORD="JonSn0w" `
    --env LDAP_BACKUP_CONFIG_CRON_EXP="0/5 * * * *" `
    --env LDAP_BACKUP_DATA_CRON_EXP="2/5 * * * *" `
    -p 389:389 `
    --volume $PSScriptRoot/database:/var/lib/ldap `
    --volume $PSScriptRoot/config:/etc/ldap/slapd.d `
    --volume $PSScriptRoot/backup:/data/backup `
    osixia/openldap-backup:1.2.5

No backup files are written.

Hi, you have an issue with your cron expresion

--env LDAP_BACKUP_CONFIG_CRON_EXP="0/5 * * * *"
--env LDAP_BACKUP_DATA_CRON_EXP="2/5 * * * *"

you have to replace 0/5 & 2/5 with */5

--env LDAP_BACKUP_CONFIG_CRON_EXP="*/5 * * * " --env LDAP_BACKUP_DATA_CRON_EXP="/5 * * * *"

You can validate a cron expresion via https://crontab.guru/

mbasri avatar Jan 05 '20 12:01 mbasri

Hello, i'm using the 1.3.0 version, but the backup does not seem to be operating. I've put the env var like this : --env LDAP_BACKUP_CONFIG_CRON_EXP="* * * * *"

It's just to see if it will run, but the backup directory stay empty. If i inspect the container, there's nothing in the crontab.

Does someone know which command is used to backup the openldap ? Maybe we can make a derivative image and put the command again inside ?

Michaël

micter59 avatar Dec 16 '20 09:12 micter59

Hi I'm using 1.40 and I cant get the backups to work either -- the will run manually if invoked from the shell.

I see the cronjobs listed within /container/run/service/slapd-backup/assets listed as such:

# Backup OpenLDAP config
"0 */4 * * *" root /sbin/slapd-backup-config 2>&1 | /usr/bin/logger -t cron_backup_config

# Backup OpenLDAP data
"0 */4 * * *" root /sbin/slapd-backup-data 2>&1 | /usr/bin/logger -t cron_backup_data
# empty line

I can run both commands manually -- /sbin/slapd-backup-data and /sbin/slapd-backup-config and see the .gz files being created. Other than running manually I do the jobs being run through cron. Nothing shows in the logs.

I see the symbolic link located within /etc/cron.d/slapd-backup -> /container/run/services/slapd-backup/assets/cronjobs.

Is my expression in correct?

/var/log/cron only shows the following:

Dec 19 17:17:01 openldap CRON[374]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Dec 19 18:17:01 openldap CRON[379]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Dec 19 19:17:01 openldap CRON[385]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Dec 19 20:17:01 openldap CRON[390]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

I realized a problem with my syntax: I had this in my docker compose:

      - LDAP_BACKUP_CONFIG_CRON_EXP="0 */4 * * *"
      - LDAP_BACKUP_DATA_CRON_EXP="0 */4 * * *"

It should be this (no quotes):

      - LDAP_BACKUP_CONFIG_CRON_EXP=0 */4 * * *
      - LDAP_BACKUP_DATA_CRON_EXP=0 */4 * * *

kevdogg avatar Dec 20 '20 03:12 kevdogg