diff options
author | Peter Palfrader <peter@palfrader.org> | 2005-12-02 11:45:25 +0000 |
---|---|---|
committer | weasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede> | 2005-12-02 11:45:25 +0000 |
commit | ba5fe40584bb4425b343a86402be7491d511277e (patch) | |
tree | 7c714e1dd9b2070d37383874b3f79291804597f6 | |
parent | 1970ab05d4c82d7a09b0d3070d9f497bd01f68f0 (diff) |
Make backup-ldap use one of two backup targets
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@34 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-x | backup-ldap | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/backup-ldap b/backup-ldap index a9d1316..0c8ee63 100755 --- a/backup-ldap +++ b/backup-ldap @@ -12,7 +12,14 @@ umask 022 SLAPCAT="/usr/sbin/slapcat" DATE=`date "+%Y%m%d-%H%M%S"` -TARGET=/var/backups/local/ldap +if [ -d /var/backups/local/ldap ]; then + TARGET=/var/backups/local/ldap +elif [ -d /var/local/backup/ldap ]; then + TARGET=/var/local/backup/ldap +else + echo "Cannot find a backup target directory" >&2 + exit 1 +fi file="$TARGET/$DATE-ldap" $SLAPCAT > "$file" @@ -25,8 +32,3 @@ if [ -e "$TARGET/MD5-$md5" ]; then else ln "$file.bz2" "$TARGET/MD5-$md5" fi - -# clean up old stuff -find "$TARGET" -name 'MD5-*' -links 1 -print0 | xargs --no-run-if-empty rm -- - - |