389 Directory Server Â (like Sun/Oracle DS) has a nice tool for taking logical backups: db2ldif. Logical backups are – simply – backups taken in an exportable format – like LDIF or SQL. They differ from raw backups – which are taken copying or snapshotting data files.
db2ldif works triggering a backup in 389: it simply tells to slapd – the ldap daemon – to export a backup on a given file
As 389DS usually runs as user “nobody”, there’s a common error you’ll se when running it:
# db2ldif -s "dc=babel,dc=it" -U -a /backup-ldap/myds.$(date -I).ldif
db2ldif: can't open /backup-ldap/myds.2012-06-14.ldif: 13 (Permission denied)
Actually it’s not the command you’re running that lacks permissions, but the user “nobody”.
# chown -R nobody /backup-ldap/
And everything will work fine!