File: migrate-ldif

package info (click to toggle)
ldap-git-backup 1.0.8-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 452 kB
  • sloc: perl: 753; sh: 501; makefile: 31
file content (23 lines) | stat: -rw-r--r-- 467 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

LDIF_DIR=$1
BKUP_DIR=$2

function usage () {
    echo "usage: $0 <LDIF_DIR> <BKUP_DIR>"
    exit 1
}

[[ -d $LDIF_DIR ]] || usage
[[ -d $BKUP_DIR ]] || usage

for filepath in `ls -1tr $LDIF_DIR/TODO/*.gz` ; do
    filename=`basename $filepath`
    echo $filename
    ldap-git-backup \
        --ldif-cmd "zcat $filepath" \
        --backup-dir $BKUP_DIR \
        --commit-msg $filename \
        --commit-date $filepath
    mv $path DONE/$filename
done