mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
19 lines
654 B
Bash
Executable file
19 lines
654 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Exit hook on subcommand error or unset variable
|
|
set -eu
|
|
|
|
# Source YNH helpers
|
|
source /usr/share/yunohost/helpers.d/filesystem
|
|
|
|
# Backup destination
|
|
backup_dir="${1}/conf/ldap"
|
|
|
|
# Backup the configuration
|
|
ynh_backup "/etc/ldap/slapd.conf" "${backup_dir}/slapd.conf"
|
|
sudo slapcat -b cn=config -l "${backup_dir}/cn=config.master.ldif"
|
|
|
|
# Backup the database (all but not the permission except the permission for mail, metronome and sftp
|
|
sudo slapcat -b dc=yunohost,dc=org \
|
|
-H 'ldap:///dc=yunohost,dc=org???(|(!(objectClass=permissionYnh))(cn=main.mail)(cn=main.metronome)(cn=main.sftp))' \
|
|
-l "${backup_dir}/dc=yunohost-dc=org.ldif"
|