"Fossies" - the Fresh Open Source Software Archive

Member "coda-6.9.5/coda-src/scripts/backup.sh" (25 Aug 2006, 1349 Bytes) of package /linux/misc/old/coda-6.9.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 # BLURB gpl
    3 # 
    4 #                            Coda File System
    5 #                               Release 6
    6 # 
    7 #           Copyright (c) 1987-2003 Carnegie Mellon University
    8 #                   Additional copyrights listed below
    9 # 
   10 # This  code  is  distributed "AS IS" without warranty of any kind under
   11 # the terms of the GNU General Public Licence Version 2, as shown in the
   12 # file  LICENSE.  The  technical and financial  contributors to Coda are
   13 # listed in the file CREDITS.
   14 # 
   15 #                         Additional copyrights
   16 #                            none currently
   17 # 
   18 #*/
   19 
   20 PATH=/bin:/sbin:/usr/bin:/usr/sbin
   21 export PATH 
   22 
   23 TAPE=/dev/nst0
   24 BACKUPDIR=/backup
   25 DATE=`date +%d%b%Y`
   26 BACKUPLOG=/vice/backuplogs/backuplog.$DATE
   27 DUMPLOG=/vice/backuplogs/dumplog.$DATE
   28 ADDR=root@localhost
   29 DUMPLIST=/vice/db/dumplist
   30 
   31 
   32 # send Henry and the robot the dumplist
   33 mail -s dumplist $ADDR < $DUMPLIST
   34 
   35 # run backup
   36 backup -t 135 /vice/db/dumplist $BACKUPDIR > $BACKUPLOG 2>&1
   37 if [ $? != 0 ]; then
   38      echo "Coda backup program failed" | mail -s '** backup failure!! **' $ADDR
   39 fi
   40 
   41 #dump to tape
   42 tape.pl --tape $TAPE --dir $BACKUPDIR --size 4000000 >> $BACKUPLOG 2>&1
   43 if [ $? != 0 ]; then
   44      echo "Coda tape.pl program failed" | mail -s '** dump failure!! **' $ADDR
   45 fi
   46 
   47 # send log to the list
   48 cat $BACKUPLOG |  mail -s "backup for $DATE" $ADDR
   49 exit 0
   50