Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backup doesn't work #9

Open
crcjwice123 opened this issue Feb 19, 2019 · 7 comments
Open

backup doesn't work #9

crcjwice123 opened this issue Feb 19, 2019 · 7 comments

Comments

@crcjwice123
Copy link

crcjwice123 commented Feb 19, 2019

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

@MiGoller
Copy link

That's exactly my issue, too.

@BertrandGouny
Copy link
Member

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

@vidarkongsli
Copy link

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.

@mbasri
Copy link

mbasri commented Jan 5, 2020

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/

@micter59
Copy link

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

@kevdogg
Copy link

kevdogg commented Dec 20, 2020

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 * * *

@esmaeelE
Copy link

esmaeelE commented Jul 8, 2024

This issue is still persists in latest image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants