Compress ldap backup.
authorValentin Vidic <vvidic@carnet.hr>
Sat, 29 Mar 2008 20:16:06 +0000 (21:16 +0100)
committerValentin Vidic <vvidic@carnet.hr>
Sat, 29 Mar 2008 20:16:06 +0000 (21:16 +0100)
src/functions.sh

index 33ac260..62dbbe7 100644 (file)
@@ -373,7 +373,7 @@ add_group_proc () {
 
 # backup ldap database
 backup_slapd_db () {
-  local ldap_backup=/var/backups/slapcat.$backup_ext
+  local ldap_backup=/var/backups/slapcat.$backup_ext.gz
   local old_umask result
 
   if [ ! -f $ldap_backup ]; then
@@ -383,7 +383,7 @@ backup_slapd_db () {
       /etc/init.d/slapd stop || true
       old_umask=`umask`
       umask 0077 # protect the backup file
-      slapcat -l $ldap_backup
+      slapcat | gzip --best > $ldap_backup
       result=$?
       umask $old_umask
       /etc/init.d/slapd start || true