From 31beabcc87a9f675916a26e7a00b6239cf8b6076 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 17 Nov 2005 16:52:44 +0100 Subject: [PATCH] Adding sample configuration, more minimal functionality --- README | 8 ++++++++ ccollect.sh | 41 +++++++++++++++++++++++++++++++++++++- conf/testshare/destination | 1 + conf/testshare/source | 1 + 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 README mode change 100644 => 100755 ccollect.sh create mode 120000 conf/testshare/destination create mode 100644 conf/testshare/source diff --git a/README b/README new file mode 100644 index 0000000..9a9d4c7 --- /dev/null +++ b/README @@ -0,0 +1,8 @@ +$CCOLLECT_CONF/ + -> Directories, which are so called 'backup-definitions' + + $dir/ + source -> file with the source + destination -> link to the destination + exclude -> \n seperated + diff --git a/ccollect.sh b/ccollect.sh old mode 100644 new mode 100755 index d6ea22a..98e0352 --- a/ccollect.sh +++ b/ccollect.sh @@ -5,6 +5,45 @@ # Last Modified: -${CCOLLECT_CONF:=/etc/ccollect} +CCOLLECT_CONF=$HOME/crsnapshot/conf +CCOLLECT_CONF=${CCOLLECT_CONF:-/etc/ccollect} +# +# ARGV: +# -s|--silent +# -p|--parallel +# -v|--verbose +# +if [ -z "$(ls $CCOLLECT_CONF 2>/dev/null)" ]; then + echo "Aborting, nothing specified to backup in $CCOLLECT_CONF" + exit 23 +fi + +for backup in $CCOLLECT_CONF/*; do + # + # Standard locations + # + + c_source="$backup/source" + c_dest="$backup/destination" + c_exclude="$backup/exclude" + + # + # Standard configuration checks + # + if [ ! -d "$backup" ]; then + echo "Ignoring $backup, is not a directory" + continue + fi + if [ ! -f "$c_source" ]; then + echo "Skipping: Source $c_source is not a file:" + continue + else + source=$(cat $c_source) || continue + fi + if [ ! -d "$c_dest" ]; then + echo "Skipping: Destination $c_dest does not link to a directory" + continue + fi +done diff --git a/conf/testshare/destination b/conf/testshare/destination new file mode 120000 index 0000000..b12e153 --- /dev/null +++ b/conf/testshare/destination @@ -0,0 +1 @@ +/home/nico/backupdir \ No newline at end of file diff --git a/conf/testshare/source b/conf/testshare/source new file mode 100644 index 0000000..597ddca --- /dev/null +++ b/conf/testshare/source @@ -0,0 +1 @@ +/home/nico/vpn