]> Dogcows Code - chaz/tar/commitdiff
Initial revision
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 1 Nov 1990 19:11:07 +0000 (19:11 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 1 Nov 1990 19:11:07 +0000 (19:11 +0000)
scripts/weekly.new [new file with mode: 0755]

diff --git a/scripts/weekly.new b/scripts/weekly.new
new file mode 100755 (executable)
index 0000000..d3e87df
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh
+# start doing things
+TOBACKUP="albert:/"
+
+HOST=`hostname | sed 's/\..*//'`
+TAPEFILE=/dev/rfd0a
+LOGFILE=tar-out
+BLOCKING=20
+TAR_PART1="/usr/local/bin/tar clbfVM $BLOCKING"
+
+rm -f $LOGFILE
+
+mt -f $TAPEFILE rewind
+
+       host=`echo $TOBACKUP | sed 's/:.*$//'`;
+       fs=`echo $TOBACKUP | sed 's/^.*://'`;
+       date=`date`;
+       fsname=`echo $TOBACKUP | sed 's/\//:/g'`
+
+       TAR_PART2="'Weekly backup of $fs on $host at $date' -C $fs ."
+       echo Backing up $TOBACKUP at $date | tee -a $LOGFILE
+
+       # Actually back things up.
+
+       if [ $HOST != $host ] ; then
+               rsh $host $TAR_PART1 $HOST:$TAPEFILE $TAR_PART2
+       else
+               sh -c "exec $TAR_PART1 $TAPEFILE $TAR_PART2"
+       fi
+       if [ $? -ne 0 ] ; then
+               echo Backup of $TOBACKUP failed. | tee -a $LOGFILE
+               echo mts at time of failure | tee -a $LOGFILE
+               mts -t $TAPEFILE | tee -a $LOGFILE
+               # I'm assuming that the tar will have written an empty
+               # file to the tape, otherwise I should do a cat here.
+       else
+               echo $date > $fsname.lasttar
+       fi
+       sleep 60;
+
+mt -f $TAPEFILE rewind
+mt -f $TAPEFILE offl
This page took 0.024669 seconds and 4 git commands to generate.