scriptsdir=$(dirname $0)
-export PATH=$scriptsdir:$PATH
+export PATH=$scriptsdir:/bin:/usr/bin:/sbin:/usr/sbin
+# source the default configuration
. config.sh
+# source the system specific configuration
+if [ -f /etc/lsbackups.conf ]
+then
+ . /etc/lsbackups.conf
+fi
+
# file locations and other values
today=$(date +%Y%m%d%H%M%S)
isoimage="$imagedir/$today.img"
echo "Creating directories"
mkdir --mode=700 -p $datadir $imagedir $isomountdir $tmpdir
-chgrp backup $imagedir
-chmod g+s $imagedir
-chmod g+w $imagedir
echo "Creating the iso image in $isoimage"
dd if=/dev/null of=$isoimage bs=1M count=0 seek=4440
} | lsbackups > $backups 2>$statusfile
echo "Running rsync to pack the image"
-rsyncopts="-l -p -t -g -o -0 --files-from=- --stats --progress"
+rsyncopts="-W -H -S -l -p -t -g -o -0 --files-from=- --stats --progress"
cat $backups | rsync $rsyncopts / $isomountdir
echo "Copying over database and status file"