summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2011-06-12 00:40:31 +0400
committerAndrew Tridgell <tridge@samba.org>2011-07-21 11:44:35 +1000
commit9117a2fa3c5f6b6d16aefc9652670a2b5e878e7c (patch)
tree7085db2302aa9ab97ec132f1c1ceb40013f77c6d /source4/scripting
parentfa194c33b2963c84b406beb1008b8de565b531b6 (diff)
downloadsamba-9117a2fa3c5f6b6d16aefc9652670a2b5e878e7c.tar.gz
samba-9117a2fa3c5f6b6d16aefc9652670a2b5e878e7c.tar.bz2
samba-9117a2fa3c5f6b6d16aefc9652670a2b5e878e7c.zip
samba_backup: check that directory really exists
Diffstat (limited to 'source4/scripting')
-rwxr-xr-xsource4/scripting/bin/samba_backup12
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/scripting/bin/samba_backup b/source4/scripting/bin/samba_backup
index 56125789d8..75ebec66e3 100755
--- a/source4/scripting/bin/samba_backup
+++ b/source4/scripting/bin/samba_backup
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (C) Matthieu Patou <mat@matws.net> 2010
+# Copyright (C) Matthieu Patou <mat@matws.net> 2010-2011
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -34,6 +34,16 @@ DIRS="private etc sysvol"
DAYS=90
WHEN=`date +%d%m%y`
+if [ ! -d $WHERE ]; then
+ echo "Missing backup directorty $WHERE"
+ exit 1
+fi
+
+if [ ! -d $FROMWHERE ]; then
+ echo "Missing or wrong provision directorty $FROMWHERE"
+ exit 1
+fi
+
cd $FROMWHERE
for d in $DIRS;do
relativedirname=`find . -type d -name "$d" -prune`