+# TODO(sesse, 2007-12-16):
+# * Sjekk hvorfor .idx-filene til UD er blitt 0 for siste fullbackuper
+# * Rydde uleselig kode fra linje 211 og litt nedover
+
+# Configuration
+LOCKFILE=/home/backup/backuprun.lockfile
+confdir=/home/backup/conf/ # Configuration files
+storagedir=/backup # Where we keep backups
+maksantallfulle=3 # Number of full backups
+dagermellomfulle=30 # Days between full backups
+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
+
+# Initially, we consider everything to be just fine.
+R=0
+
+# Die more or less gracefully (at least notify user)
+die() {
+ echo `date`": Something nasty happened, and since I fork a lot:"
+ echo `date`": I CANNOT CLEAN UP THE MESS MYSELF."
+ echo `date`": You need to get rid of lost process named stuff like $0, tar and ssh."
+ exit 255
+}
+
+# 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, exiting."
+ echo `date`": $LOCKFILE exists, exiting." >&2
+ exit 1
+fi;
+touch $LOCKFILE
+
+#syntax of remotestat:
+#hostname:/directory/
+remotestatf=$confdir/remotestat
+[ -f $remotestatf ] && remotestat=`cat $remotestatf`
+###
+
+PATH=/local/bin:$PATH:/store/bin