# The script is halfway Norwegian and halfway English. Newer modifications are
# in English, we should probably stick to that.
-# The computer to backup.
-computer=$1
-
-# Configuration
-LOCKFILE=/home/backup/backuprun.lockfile.$computer
-confdir=/home/backup/conf/ # Configuration files
-storagedir=/backup # Where we keep backups
-maxnumfull=3 # Number of full backups
-daysbetweenfull=30 # Days between full backups
-daysbetweenfullforfixed=32 # Days between full backups for machines with fixed
- # full-backup date (in case the fixed day gets missed)
-DAY_OF_MONTH=`date "+%d" | sed s/^0//` # from 1 to 31
-DATE=`date "+%Y%m%d%H%M"` #format: touch
-DATEs=`date "+%Y-%m-%d %H:%M"` #format: tar
-
-# Exclude-pattern
-exclude=$confdir/exclude
-[ ! -f $exclude ] && printf "tmp\ncore\n" > $exclude
+SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" # Absolute directory the script lives in
+confdir=$SCRIPTPATH/conf/ # Directory configuration files
+[ -r $confdir/env ] && . $confdir/env
+
+# Default configuration; used unless $confdir/env has set something different.
+storagedir=${storagedir:-/backup} # Where we keep backups
+exclude=${exclude:-$confdir/exclude} # List of exclude patterns
+maxnumfull=${maxnumfull:-3} # Number of full backups
+daysbetweenfull=${daysbetweenfull:-30} # Days between full backups
+
+# Days between full backups for machines with fixed full-backup date
+# (in case the fixed day gets missed).
+daysbetweenfullforfixed=${daysbetweenfullforfixed:-32}
+
+# End of configuration.
+
+computer=$1 # The computer to backup.
+LOCKFILE=$SCRIPTPATH/backuprun.lockfile.$computer
+DAY_OF_MONTH=`date "+%d" | sed s/^0//` # from 1 to 31
+DATE=`date "+%Y%m%d%H%M"` # format: touch
+DATEs=`date "+%Y-%m-%d %H:%M"` # format: tar
if [ -z "$computer" ]; then
echo "Usage: $0 COMPUTER"
exit 1
fi
+[ ! -f $exclude ] && printf "tmp\ncore\n" > $exclude
+
# Die more or less gracefully (at least notify user)
die() {
warnmsg "Aborting."