Adding sample configuration, more minimal functionality
This commit is contained in:
parent
4ba9ce854d
commit
31beabcc87
4 changed files with 50 additions and 1 deletions
8
README
Normal file
8
README
Normal file
|
@ -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
|
||||
|
41
ccollect.sh
Normal file → Executable file
41
ccollect.sh
Normal file → Executable file
|
@ -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
|
||||
|
|
1
conf/testshare/destination
Symbolic link
1
conf/testshare/destination
Symbolic link
|
@ -0,0 +1 @@
|
|||
/home/nico/backupdir
|
1
conf/testshare/source
Normal file
1
conf/testshare/source
Normal file
|
@ -0,0 +1 @@
|
|||
/home/nico/vpn
|
Loading…
Reference in a new issue