+# Configuration
+LOCKFILE=/home/backup/backuprun.lockfile.$computer
+confdir=/home/backup/conf/ # Configuration files
+storagedir=/backup # Where we keep backups
+maksantallfulle=3 # Number of full backups
+dagermellomfulle=30 # Days between full backups
+dagermellomfulleforfast=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
+
+if [ -z "$computer" ]; then
+ echo "Usage: $0 COMPUTER"
+ exit 1
+fi
+
+# Die more or less gracefully (at least notify user)
+die() {
+ echo `date`": Something nasty happened. Ending, and not deleting lockfile $LOCKFILE."
+ exit 1
+}
+
+# Trap C-c and kill
+trap die SIGINT SIGTERM
+
+# Don't start if we're already running
+if [ -e $LOCKFILE ]; then
+ echo `date`": $LOCKFILE exists for pid `cat $LOCKFILE`, exiting."
+ echo `date`": $LOCKFILE exists for pid `cat $LOCKFILE`, exiting." >&2
+ exit 1
+fi;
+touch $LOCKFILE
+echo $$ > $LOCKFILE
+
+echo `date`": Backup run starting" >&2