6. Backup und Restore
                            =====================
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 1





  
  Backup - warum und wieso??
  --------------------------
  
  Daten und Dateien gehen verloren:
  
     - Nutzer löschen versehentlich Dateien
             rm  xyz *
     - ein fehlerhaftes Programm zerstört Daten 
     - zwei Nutzer verwenden das gleiche Programm mit den gleichen Daten
     - Stromausfall, fehlendes Sync, 10 Stunden Arbeit futsch
     - Hardwarefehler
  
  Entwicklung einer Backup-Planes:
  
  Kernfragen:
  
  1. Welche Daten (Dateien) müssen gesichert werden?
  2. Wie häufig ändern sich die Daten?
  3. Wann, wie oft, zu welchen besonderen Zeitpunkten muß gesichert 
     werden?
  4. Auf welchen Datenträgern/Filesystem stehen die Daten?
  5. Wie groß sind die zu sichernden Datenbestände?
  6. Wie schnell müssen die Daten nach einem Crash wieder verfügbar
     sein?
  7. Wohin sollen die Daten zurückgespeichert werden?
  8. Welches Sicherungsmedium soll verwendet werden?
  9. Wer sichert die Daten?
 
 
nextback     6. Backup und Restore     WS 2013/14 - 2





  
  Planung von Backup- und Restore Kapazitäten
  -------------------------------------------
  
  1. Festlegen des idealen Backupzeitplans
        welche Daten werden gesichert?
        wie häufig müssen die Daten gesichert werden?
        Welche Gliederung der Daten ist sinnvoll?
  
  2. Vergleich des Plans mit den Möglickeiten der Umgebung
        Wann stehen die Daten zur Verfügung (offene Dateien)?
        Wann sind die Systeme unbenutzt?
        Welche Backuplaufwerke stehen zur Verfügung?
        Praktische Backupgeschwindigkeit (Netzwerk)?
  
  3. Kapazitätsplanung
  
  4. Anpassung des Planes an die Realität
  
  5. Test des Planes und Modifizierung des Planes
  
  6. Testen der Restore-Operationen
  
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 3





  
  Backuptypen
  -----------
  
    Full-Backup: vollständiger Abzug eines Datenbestandes
  
           Vorteil:  Alle Daten immer vorhanden, sicher, kurze Restore-Zeiten
           Nachteil: Lange Backup-Zeiten 
                     dadurch lange Ausfallzeiten des Systems
                     Abzugsleistungen aktueller Systeme (2009):
                         40-100 MB/sec d.h. 140 - 360 GB pro Stunde
                     Voraussetzungen: GBit-Netzwerk, schnelle Pufferspeicher 
                         auf dem Backupserver, mehrere Tapedevices.
  
    Inkrementelles Backup: Abzug der bezüglich eines vorherigen
                     inkrementellen oder vollen Backups geänderten Daten
  
           Vorteil:  Schnell, kurze Backup-Zeiten (360 GB pro Stunde)
           Nachteil: eventuell lange Restore-Zeiten (alle inkrementellen
                     Backups müssen durchgangen werden)
 
 
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 4





  
  Backupstrategien
  ----------------
  
  1. Für sehr aktive Systeme
  
    Sonntag:    Level 0   (Full-Backup)
    Montag:     Level 1   (Inkrem. Backup)
    Dienstag:   Level 2
    Mittwoch:   Level 3
    Donnerstag: Level 4
    Freitag:    Level 5
    Sonnabend:  Level 6
  
   Zahl der Datenträger: mind. 7
  
   Vorteile:  Nur die täglich geänderten Daten müssen gesichert 
              werden. Kurze Abzugszeiten
   Nachteile: Bei einem Crash am Freitag müssen 5 Datenträger
              zurückgespielt werden, häufig Full-Backup
 
 
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 5





  
  2. Für aktive Systeme mit geringem Umfang an geänderten Daten
  
    Sonntag:    Level 0   (Full-Backup)
    Montag:     Level 1   (Inkrem. Backup)
    Dienstag:   Level 1
    Mittwoch:   Level 1
    Donnerstag: Level 1
    Freitag:    Level 1
    Sonnabend:  Level 1
  
   Zahl der Datenträger: mind. 3
  
   Vorteile:  Nur zwei Datenträger werden für ein vollständiges Backup
              benötigt. Einfach zu automatisieren (cron).
  
   Nachteile: Stetig wachsende Länge der Abzüge während der Woche.
              Häufige full-Backups.
 
 
 
 
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 6





  
  3. Für aktive Systeme mit sich wöchentlich ändernden Daten
  
    1.Sonntag im Monat:    Level 0   (Full-Backup)
    sonst Sonntag:         Level 1   (inkrem. Backup)
    Montag:                Level 2   (Inkrem. Backup)
    Dienstag:              Level 2
    Mittwoch:              Level 2
    Donnerstag:            Level 2
    Freitag:               Level 2
    Sonnabend:             Level 2
  
   Zahl der Datenträger: mind. 4
  
   Vorteile:  Drei Datenträger werden für ein vollständiges Backup
              benötigt. Nur einmal im Monat ein Full-Backup.
  
   Nachteile: Stetig wachsende Länge der Abzüge
 
 
 
 
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 7





  
  4.1 Für Systeme mit sehr großen Datenbeständen
  
    Beim Einrichten des Backupsystems:      Full-Backup
    Beim Hinzufügen von neuen Filesystemen: Full-Backup des neuen Filesystems
    
    täglich:          inkrementelles Backup
  
    Full-Backup auf Anforderung, wenn Zeit ist oder wenn notwendig!!!
  
    Vorteil:  nur geänderte Daten werden abgezogen, 
              schnell
              nach der Installation kein Full-Backup mehr
              alle Versionen einer Datei vorhanden
              täglich geringer Bedarf an Speicherkapazität (nur abhängig
              von den Änderungen)
  
    Nachteil: hoher Hardwarekosten: ständig neue Medien
              hoher Administrationsaufwand
              nach längeren Phasen ohne Full-Backup dauert das Rückspeichern
              unter Umständen sehr lang (viele Medien werden benötigt)
              Wenn der Full-Backup nicht lesbar ist, war alles umsonst
              Recovery von Medien problematisch aber möglich
    
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 8





  
  4.2 Für Systeme mit sehr großen Datenbeständen
  
      Vollständiger Abzug aller Daten in einem vorgegeben Zeitraum.
  
  
      Vorteile:  täglich eine gleich große Menge von Daten, die abgezogen werden
                 Alle Daten nach einem gewissen Zeitraum mehrfach gesichert.
                 Kein Totalverlust möglich.
                 Begrenzte Zahl von Medien beim Restore notwendig.
                 Medien sind nach gewisser Zeit wiederverwendbar.
  
      Nachteile: täglich große Menge von Daten, unabhängig von eventuellen
                 Änderungen
                 täglich großer Bedarf an Speichermedien.
                 
  
 
 
 
 
 
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 9





  
  Sicherheitsaspekte
  -----------------
  
  !!!!Backups laufen in der Regel unbeaufsichtigt. Die Laufwerke und
  Datenträger sind gegen unbefugten Zugriff zu schützen!!!!!
  
  Lagerung der Backupmedien:
    Ordnung ist das halbe Leben!!!
    Korrekte Kennzeichnung aller Datenträger.
    Bereitstellung von Restore-Prozeduren für alle Fälle.
    Hinzufügen von Kochrezepten zu den Datenträgern.
    Schreibschutz nach dem Backup aktivieren!!!
    Lagern der Datenträger in der richtigen Umbegung.
    Schutz gegen Diebstahl und Kathastrophen.
    Lagerung eines 2.Satzes von Backupmedien an einem anderen Ort.
  
  Der Ernstfall muß geprobt werden!!!!!
  
  Backupmedien
  ------------
  
  Disketten
  ---------
     720 KB
     1,2 MB
     1,44 MB
     2,88 MB
   120,00 MB  Superdisketten
 
nextback     6. Backup und Restore     WS 2013/14 - 10





  
  Wechselplatten (Zip, Jaz)
  -------------------------
     100 MB Zip 
     250 MB Zip
     750 MB ZIP
       1 GB JAZ-Laufwerk
       2 GB JAZ-Laufwerk)
  
  Wechselplatten
  --------------
     200-1000 GB  hotswap
  
  Festplatten
  -----------
     bis 1000 GB
  
  Festplattensysteme
  ------------------
     40 TB, 320 MB/s
  
  Magneto-optische Platten
  ------------------------
     230 MB, 640 MB, 1,3 GB, 2,6 GB
  
  CD-RAM, CD-RW
  -------------
     600-800 MB
 
 
nextback     6. Backup und Restore     WS 2013/14 - 11





  DVD-RAM, DVD-RW
  ---------------
     6-7 GB
  
  Magnetbänder
  ------------
     9-Spur-Magnetbänder (1964)
        10 MB-500 MB
     DLT-Magnetbänder (1984)
        4 GB-800 GB, bis 60 MB/s, Komp. 2:1
     QIC-Magnetbänder (1/4" Cartridge) (1989)
        1 GB-20 GB, bis 4 MB/s, 2:1
     DAT-Magnetbänder DDS1/2/3/4  (4mm breit 60-150 m lang) (1989)
        4 GB-24 GB, 60-150m, bis 3 MB/s, Komp. 2:1
     EXA-Byte-Magnetbänder (8mm breit, 90 m lang) (1999)
        4 GB-320 GB, bis 24 MB/s, Komp. 2:1
     DLT-1-Kassetten (1991)
        40 GB, 3 MB/s
     DLT-V4-Kassetten (2005)
        160 GB, 10 MB/s
     DLT-V5-Kassetten (2006)
        250 GB, 18 MB/s
     StorageTek T9840B (2001)
        20 GB, 3 MB/s (nativ)
     StorageTek T9840B (2006)
        500 GB, 120 MB/s (nativ)
     StorageTek T10000D (2013)
        8,5 TB, 252 MB/s (nativ) 
  
 
nextback     6. Backup und Restore     WS 2013/14 - 12





  
     LTO-1-Magnetbänder (2000)
        100 GB, 20 MB/s (nativ), Komp. 2:1
     LTO-5-Magnetbänder (2010)
        1500 GB, 140 MB/s (nativ), Komp. 2:1
     LTO-6-Magnetbänder (2011)
        2,5 TB, 160 MB/s (nativ), Komp. 2,5:1
     LTO-7-Magnetbänder (2013)
        6,5 TB  180 MB/s, (nativ, Komp. 2,5:1
  
  
  Stacker,Jukeboxen
  -----------------
  
     4-12 Magnetbänder in einem Magazin für ein/zwei Laufwerke:
               DAT, EXA, LTO, DLT
  
  Tape-Libraries
  --------------
  
     bis 600 Magnetbänder,  bis 10 Laufwerke, DLT, LTO, StorageTek
  
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 13





  Preisvergleich (2010)
  ----------------------
             Kapazität  Gerätepreis     Mediumpreis      minimale Lebenszeit
                          Euro            Euro            Jahre
  diskette   1,4 MB         15             0.25              2
  Super-Disk 120 MB        120             8                2-3
  ZIP        100 MB         80             5                3-5
             250 MB        100             12               3-5
             750 MB        130             16               3-5
  Jaz          1 GB        400             40               4-5
               2 GB        400             60               4-5
  CD-RAM     700 MB         40             0.30              5
  CD-RW      600 MB         40             0,50              5
  DVD-R      4,7 GB        100              1                5 ?
  DVD-RW     4,7 GB        100              1                5 ?
  DAT          4 GB        500              6               3-4
              12 GB        600             10               3-4
              24 GB        800             16               3-4
  EXA          4 GB        800              6               3-4
              20 GB        900             10               3-4
              60 GB       1000             16               3-4
             300 GB       1000             20               3-4
  DLT         40 GB       1000             40                10
             800 GB       1500             70                10
  LTO        100 GB       4000             40                10
            1600 GB       4000            120                10
  MO-Disk    5,2 GB        500             70               15 ?
  HD - IDE  1000 GB        100              -               3-7 ?
  HD - SCSI  300 GB        200              -               5-10 ?
 
nextback     6. Backup und Restore     WS 2013/14 - 14





  Einfache Sicherungsprogramme
  ----------------------------
  tar - Tape ARchiver
  ------------------
    SunOS:
       tar [ - ] c|r|t|u|x [ bBefFhilmopvwX014578 ] [ tarfile ]
            [ blocksize ] [ exclude-file ] [ -I include-file ]
            filename1 filename2 ...  -C directory filenameN ...
  
    Solaris:
       tar c [bBefFhiloPvwX [ 0-7 ]] [ block ] [ tarfile ]
            [ exclude-file ] { -I include-file |
            -C directory file | file } ...
       tar r [ bBefFhilvw [ 0-7 ]] [ block ]
            { -I include-file | -C directory file | file } ...
       tar t [ BefFhilvX [ 0-7 ]] [ tarfile ]
            [ exclude-file ] { -I include-file | file } ...
       tar u [ bBefFhilvw [ 0-7 ]] [ block ] [ tarfile ] file ...
       tar x [ BefFhilmopvwX [ 0-7 ]] [ tarfile ]
            [ exclude-file ] [ file ... ]
  
    DEC-UNIX:
       tar required_flag[bBefFhilLmpPsSvVwzn][n|o] [flag_argument ...] 
            [-e exception] ...  [-C directory] ...  [file ...]
       tar -_required_flag[optional_flag] [flagargument] ...
            [n | o] [flagargument ...] [-e exception] ...
            [-C directory] ...  [file ...]
  
    HP-UX:
        tar key [arg...] [file | -C directory] ...
nextback     6. Backup und Restore     WS 2013/14 - 15





    AIX:
       tar {-c|-r|-t|-u|-x} [-b Blocks] [-B] [-C Directory] [-d] [-F]
           [-h] [-i] [-L InputList] [-l] [-m] [-N Blocks] [-p] [-s] 
           [-v] [-w ] [-Number] [-f Archive] 
           [-S Blocksb | -S Feet | -S Feet@Density]
           [File ...| Directory ... ]
  
  Allgemeingültige Optionen von tar:
    Hauptfunktionen:
       c  -  Archiv erzeugen
       r  -  Files an Archiv anfügen
       t  -  Directroy des Archivs anzeigen
       u  -  Update
       x  -  Extrakt von Files aus dem Archiv
    Wichtige zusätzliche Optionen:
       b  -  Blockgröße ( Blocks*512 Byte), B - Pipe
       f  -  Name des Archivfiles
       h  -  Symbolischen Links folgen
       i  -  igoriere Checksummenfehler
       m  -  Modifikatione Time ergibt sich aus aktueller Zeit
       p  -  Files mit orginale Zugriffsrechte erstellen
       s  -  abschneiden führender "/"
       C  -  Change Dir
       v  -  Ausführliches Protokoll
  
  Bemerkungen:
   - Magnetbandfehler problematisch
   - Filenamenlänge: 256 Bytes, Linknamenlänge: 100 Bytes
   - Benutzung von tar zur Datenübertragung zwischen
     verschiedenen Betriebssystemen problematisch
nextback     6. Backup und Restore     WS 2013/14 - 16





  GNU-tar:
        gtar [OPTION]... [FILE]...
   Main operation mode:
      -t, --list              list the contents of an archive
      -x, --extract, --get    extract files from an archive
      -c, --create            create a new archive
      -d, --diff, --compare   find differences between archive and file system
      -r, --append            append files to the end of an archive
      -u, --update            only append newer files in archive
      -A, --catenate          append tar files to an archive
          --concatenate       same as -A
          --delete            delete from the archive (no tape)
   Operation mode modificators:
      -W, --verify            verify the archive after writing it
      --remove-files      remove files after adding them to the archive
      -k, --keep-old-files    don't overwrite existing files
      -S, --sparse               handle sparse files efficiently
      -O, --to-stdout            extract files to standard output
      -G, --incremental          old GNU-format incremental backup
      -g, --listed-incremental   new GNU-format incremental backup
          --ignore-failed-read   ignore i/o-errors
   Handling of file attributes:
      --atime-preserve        don't change access times on dumped files
      -m, --modification-time don't extract file modified time
      --same-owner        create extracted files with the same ownership 
      -p, --same-permissions  extract all protection information
      --preserve-permissions  same as -p
      -s, --same-order        sort names to extract to match archive
      --preserve-order        same as -s
      --preserve              same as both -p and -s
nextback     6. Backup und Restore     WS 2013/14 - 17





  
   Device selection and switching:
      -f, --file=[HOSTNAME:]FILE  use archive file 
      --force-local           archive file is local even if has a colon
      --rsh-command=COMMAND   use remote COMMAND instead of rsh
      -[0-7][lmh]             specify drive and density
      -M, --multi-volume      create/list/extract multi-volume archive
      -L, --tape-length=NUM   change tape after writing NUM x 1024 bytes
      -F, --info-script=FILE  run script at end of each tape (implies -M)
          --new-volume-script=FILE   same as -F FILE
  
   Device blocking:
      -b, --block-size=BLOCKS    block size of BLOCKS x 512 bytes
      --block-compress      block the output of compression for tapes
      -i, --ignore-zeros    ignore blocks of zeros in archive (means EOF)
      -B, --read-full-blocks  reblock as we read (use with pipes)
  
   Archive format selection:
      -V, --label=NAME            create archive with volume name NAME
      -o, --old-archive, --portability  
                                  write a V7 format archive (not ANSI)
      -z, --gzip, --ungzip        filter the archive through gzip
      -Z, --compress, --uncompress  filter the archive through compress
      --use-compress-program=PROG   filter through PROG (must accept -d)
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 18





  
   Local file selection:
      -C, --directory DIR      change to directory DIR
      -T, --files-from=NAME    get names to extract or create from
                               file NAME
          --null             -T reads null-terminated names, disable -C
          --exclude=FILE       exclude file FILE
      -X, --exclude-from=FILE  exclude files listed in FILE
      -P, --absolute-paths     don't strip leading `/'s from file names
      -h, --dereference        dump instead the files symlinks point to
      -l, --one-file-system    stay in local file system 
                               when creating archive
      -K, --starting-file=NAME begin at file NAME in the archive
      -N, --newer=DATE         only store files newer than DATE
          --after-date=DATE    same as -N
  
   Informative output:
      --help            print this help, then exit
      --version         print tar program version number, then exit
      -v, --verbose     verbosely list files processed
      --checkpoint      print directory names while reading the archive
      --totals          print total bytes written while creating archive
      -R, --record-number   show record number within archive 
                        with each message
      -w, --interactive     ask for confirmation for every action
      --confirmation    same as -w
  
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 19





  
  tar-Beispiele:     
  
  Backup:
    tar -xbfp 20 /dev/rmt1h
    tar xbfp 20 /dev/rmt1h
    tar -xb 20 -f /dev/rmt1h -p
    tar -c /usr1      --> /dev/rmt1 (default)
    tar -cf /dev/rmt1 /usr1 /usr2 /usr3/unixsoft
    tar -cf /dev/rmt1 -C /usr/include . -C /etc .
    cd /usr3
    tar -cf /dev/rmt1 ./unixsoft ./simulant
    tar cvBbf 20 - ./simulant | ssh kirk "dd of=/dev/rmt0 obs=20b"
  
  Inhaltsverzeichnis:
    tar tvf /dev/rmt1
  
  Restore:
    tar -xvf /dev/rmt1 
    tar -xvf /dev/rmt1  /usr1
    tar -xvf /dev/rmt1  unixsoft
    tar -xf /dev/rmt1 ./unixsoft
    ssh  kirk "dd if=/dev/rmt0 bs=20b" | tar xvBbf 20 - ./simulant
  
   Inkrementelle Backup:
    tar -cf /dev/rmt0 `find /usr1 -mtime -1 ! -type d -print`
  
   Kopieren eines Directory-Baumes:
    cd fromdir; tar cBf - . | (cd todir ; tar xBfp -)
  
nextback     6. Backup und Restore     WS 2013/14 - 20





  cpio - CoPy file achives In and Out
  -----------------------------------
  SunOs:
       cpio -o [aBcv]
       cpio -i [bBcdfmrsStuv6] [patterns]
       cpio -p [adlmuv] directory
  SOLARIS:
       cpio -i [bBcdfkmPrsStuvV6] [-C bufsize] [-E file] [-H header] 
               [-I file [-M message]] [-R id] [pattern ...]
       cpio -o [aABcLPvV] [-C bufsize] [-H header]
               [-O file [ -M message]]
       cpio -p [adlLmPuvV] [-R id] directory
  DEC-UNIX:
       cpio -o[aBchvV] [-C value] [-M "string"] [-Odevice]
       cpio -i[bBcdfmrsStuvz6] [-C value] [-M "string"] [-Idevice] 
              [pattern ...]
       cpio -p[adlmruvV] directory
  HP-UX:
       cpio -o [aABcxvCh]
       cpio -i [BdcrtuxvmfPsSb6RU] [patterns]
       cpio -p [aduxvlmrU] directory
  AIX:
       cpio -o [acvB] | [C Value]  < FileName > Output
       cpio -i [bcdfmrstuvS6B] | [C Value] [Pattern ... ] < Input
       cpio -p [adlmuv]  Directory < FileName
  
  Funktionen:
     i - Files aus dem Archiv extrahieren
     o - Files in ein Archiv schreiben
     p - Files in eine Directory kopieren
nextback     6. Backup und Restore     WS 2013/14 - 21





  Wichtige Optionen:
     a  - aktuelle Zeit wird Access-Time der kopierten Files 
     b  - Swap Bytes und Halbwörter (nur bei -i)
     B  - Blockgröße 5120 Bytes, C value - Blockgröße 
     c  - Headerinformationen als ASCII-Text
     d  - erzeuge Directories, wenn notwendig
     h  - cpio folgt symbolischen Links
     m  - Rücksetzen der Modifikationszeit
     s  - Swap Bytes, S  - Swap Halbworte
     t  - erzeuge Inhaltsverzeichnis (nur bei -i)
     v  - ausführliches Protokoll
     
  cpio-Beispiele:
  ---------------
  
  Backup:
  -------
    find /usr1 -print | cpio -ocv > /dev/rmt1
    find /usr1 -print | cpio -ov -O/dev/rmt1
    cd /usr1; ls ./* | cpio -ocv > /vol/fob-vol5/bell/cpio.dat
    find /usr1 -cpio /dev/rmt1
    find /usr1 -cpio /dev/rmt1 -print
    cd /usr1
    find . -print | cpio -o >/dev/rmt1
  
  Inhaltsverzeichnis:
    cpio -itvB < /dev/rmt1
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 22





  
   Restore:
  ---------
    cpio -idmvB < /dev/rmt1
    cpio -idmvB  -I/dev/rmt1
    cpio -id -I/dev/rmt1 "*.c"
    cpio -idr -I/dev/rmt1 "*.c"    # ask for rename
  
  Inkrementelle Backup:
  ---------------------
    find /usr1 -mtime -1 ! -type d -print | cpio -o > /dev/rmt1
  
  Kopieren einer Directory-Baumes:
  --------------------------------
    cd /usr1; find ./unixsoft -print | cpio -pdm /usr2
    /bin/ls | cpio -pd  ../newdir
  
  #!/bin/sh
  #   wöchentliches archivieren von / nach /home
  cd /
  /bin/rm /home/archiv/week-level2
  /bin/mv /home/archiv/week-level1 /home/archiv/week-level2
  /bin/mv /home/archiv/week-level0 /home/archiv/week-level1
  /bin/find . -xdev -newer /etc/archiv.index   -print | \
      /bin/sort |/bin/cpio -o >/home/archiv/week-level0
  cd /vol/epsilon-vol3/unixsoft/bell/bellus
  /bin/rm week-level2
  /bin/mv week-level1 week-level2
  /bin/mv week-level0 week-level1
  /bin/cp /home/archiv/week-level0 week-level0
nextback     6. Backup und Restore     WS 2013/14 - 23





  Dump-Programme
  --------------
  SunOS:
       /usr/etc/dump [ options [ arguments ] ] filesystem
       /usr/etc/dump [ options [ arguments ] ] filename ...
       /usr/etc/rdump [ options [ arguments ] ] filesystem
       /usr/etc/rdump [ options [ arguments ] ] filename ...
       dump [-0..9cDnuvwW] [-a archive-file] [-b blocks] [-d density]
            [-f dumpfile] [-s size] [-t tracks] filesystem
      
  Solaris:
       dump  -  kein Abzugsprogramm
       /usr/sbin/ufsdump [options] [arguments] files_to_dump
       ufsdump [-0..9cDlnoSuvwW] [-a archiv-file] [-b blocks]
               [-d density] [-f dump_file] [-s size] [-t tracks]
               filesystem
  
  DEC-UNIX:
      /usr/sbin/dump [key [argument	...] file system]
      /usr/sbin/rdump -f dump_file [otherkey [argument ...] file system]
      dump [-0..9cuwBENVW] [-b blocks] [-d density] [-f dump_file] 
           [-L Label] [-s size] [-S tape_size]  filesystem
  
  HP-UX:
        /etc/dump [option [argument ...] filesystem]
        /etc/rdump [option [argument ...] filesystem]
        dump [-0..9nuWw] [-b blocks] [-d density] [-f device] [-s size]
  
  AIX: 
        kein dump
nextback     6. Backup und Restore     WS 2013/14 - 24





  
  linux:  ext2/ext3/ext4
  
       dump  [-level#]  [-ackMnqSuv]  [-A file] [-B records] [-b blocksize] 
             [-d density] [-D file] [-e inode numbers] [-E file] [-f file] 
             [-F script] [-h level] [-I nr errors] [-jcompression level] 
             [-L label] [-Q file] [-s feet] [-T date] [-y] [-zcompression level] 
             files-to-dump
  
         dump [-W | -w]
  
              /etc/fstab  -     filesystems and frequency
              /etc/dumpdates  - dump date records
              /etc/mtab       - mounted file systems
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 25





  Allgemeine Optionen für dump:
    -0-9    Dumplevel (/etc/dumpdates)
    -b nn   Anzahl der 512/1024-Bytes Blöcke pro E/A-Operation
    -B      Blockmodegerät
    -c      kein 9-Spur-Magnetband 
    -d density          Schreibdichte  in bpi
    -f name             Dump-File-Name, - Standardausgabe
    -l block-numbers    Medium-Länge in 512-Byte-Blocks
    -L label            Bandlabel
    -n Benachrichtigung der Nutzer der Gruppe "operator",
       wenn ein Eingriff erforderlich ist
    -s size             Länge des Bandes in Fuß
    -S tape_size        Geräte-Kapazität in 1024-Byte-Blöcken (-B)
    -u      update /etc/dumpdates
    -B      Blockmodegerät
    -E      Protokollspezifikation   12345 blocks,  0.05 volumes
    -N      kein Rückspulen
    -S nn   Ausgabefilelänge in Fuß oder in 1024 Byte-Blocks (-B)
    -T nn   Nummer des ersten Tapes
    -v      verify
  Angaben für Blocks, Density und Size in Abhängigkeit von der
  Kapazität des Laufwerkes:
      Kapazität      Density       Size       Blocks
      150 MB           6250         1925       141056
      200 MB           38000         436       194560
      280 MB           10000        2457       287948
      1   GB           61000        1584      1132646
      2   GB           61000        2640      1887436
      2,3 GB           54000        6000      2000000
      4   GB           54000        7456      4718592
nextback     6. Backup und Restore     WS 2013/14 - 26





  Beispiel /etc/dumpdates:
        /dev/rrz10c 1 Wed May 21 21:00:01 1997
        /dev/rrz10c 0 Sat May 17 14:00:01 1997
        /dev/rrz11c 1 Wed May 21 22:00:01 1997
        /dev/rrz11c 0 Sat May 17 16:00:01 1997
        /dev/rrz12c 1 Wed May 21 23:30:01 1997
        /dev/rrz12c 0 Sat May 17 18:00:01 1997
        /dev/rrz13c 1 Wed May 21 19:00:01 1997
        /dev/rrz13c 0 Sat May 17 10:00:00 1997
  Beispiele für Backup-Scripte:
       #!/bin/sh     Abzug offline auf Platte
       if [ $# != 2 ] ; then
          echo "use: $0 <volume> <level>"
          echo "   <volume> : 1..5
          echo "   <level>  : dumplevel  (0, 1)"
          exit 1
       fi
       DIRECTORY=/vol/fob-vol5/bell/Epsilon/
       FILE=eps-usr$1l$2d`date +"%Ow"`.dgz
       if [ "$2" = "0" ] ; then
           FILE=eps-usr$1l$2w`date +"%OU"`.dgz
       fi
       ARCHIVFILE=${DIRECTORY}${FILE}
       echo "Directory: /usr$1"
       echo -n "Inhalt: "   ; ls /usr$1
       echo "Belegung"      ; df /usr$1
       echo "/sbin/dump -${2}un -f - -b54 /usr$1 | \
                 /usr/etc/gzip -c > $ARCHIVFILE"
       /sbin/dump -${2}un -f - -b54 /usr$1 | \
                       /usr/etc/gzip -c > $ARCHIVFILE
nextback     6. Backup und Restore     WS 2013/14 - 27





  Beispiel für Remote-Abzug:
       #!/bin/sh     Abzug online auf Band auf kirk
       echo  Abzug  von  BELLUS
       echo Dieses Programm dient zum Automatisieren der Abzüge der Platten
       echo / /usr  /home
       echo Wenn ein tape fertig ist, bekommt der Bediener eine mail
       echo Bitte den mail-namen eingeben
       echo -n "user: "
       read user
       echo Abzug von     bellus     durch ${user}   auf kirk
       for i in / /usr /home
       do
         echo dump von $i  von  bellus
         echo Bitte tape einlegen  auf  kirk
         jn=""
         until test "${jn}" = "j" -o "${jn}" = "n"
           do
             echo -n "weiter? j/n: "
             read jn
             if test "${jn}" = "j"
               then
                 /etc/rdump 0ubdsf 126 27000 24000 kirk:/dev/rst0 $i
                 ssh kirk /bin/mt -f /dev/rst0 rewoff
                 /usr/ucb/mail -s "bellus-Band $i auf bellus fertig"
                                                         ${user} << mail
                   Achtung $i von   bellus  ist fertig
                   Bitte Band auf  kirk  wechseln .
       mail
               else
                 echo ende
nextback     6. Backup und Restore     WS 2013/14 - 28





             fi
         done
       done
       echo dump von  /home  von  bellus fertig
       echo -n "bitte Band and kirk entnehmen und Taste drücken [jn]: "
       read jn
       echo Danke
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 29





  Weitere Backup-Programme:
  HP-UX:
  
        fbackup -f device [-f device] ...  [-0-9] [-uvyAH] [-i path]
                 [-epath] [-g graph] [-I path] [-V path] [-c config]
        fbackup -f device [-f device] ...  [-R restart] [-uvyAH] 
                 [-I path][-V path] [-c config]
  
        Beispiel: 
           /etc/fbackup -0i /usr -e /usr/lib -f /dev/rmt/0h
  
  AIX:
  
    analog dump:
      backup  [-b blocks] [-c] [-f Device] [-lblock-number] [-0..9] [-u] 
              [-w] [-W] FileSystem
  
       Beispiel:
           backup -0 -u /
           backup -1 -u /
    analog cpio
      backup  -i [-b blocks ] [-p[-eRegularExpression]][-f Device] 
              [-lblock-number] [ -o] [-q] [-v]
  
       Beispiel:
           backup -i < filelist
           find . -print | backup -i -v    # zum Default Backup-Dev.
        
  
  Wer A sagt muß auch B sagen. 
nextback     6. Backup und Restore     WS 2013/14 - 30





  
  Restore-Programme
  -----------------
  
  SunOS:
     /usr/etc/restore -i | -r | -R | -t | -x [-cdhmvy] [-a archiv-file]
                      [-b blocks] [-f dump-file] [-s n] [filename]
  
  Solaris:
       /usr/lib/fs/ufs/ufsrestore i | r | R | t | x [abcdfhmsvy]
            [ archive_file ] [ factor ] [ dumpfile ][ n ]
            [ filename ...  ]
  
  DEC-UNIX:
    /usr/sbin/restore -[function_flag][modifier_flag ...] [argument ...]
    /usr/sbin/rrestore -f dump_file -[function_flag][modifier_flag ...]
                       [argument ...]
     restore -i | -r | -R | -t | -x  [-cdhmNvyYZ] [-b blocks]
             [-f dumpfile] [-F command-file] [-s n]
  
  HP-UX:
        /etc/restore key [name ...]
        /etc/rrestore key [name ...]
        restore r | R | x | t | i | [shmvy] [b blocks] [f dump_file]
  
  AIX:
       kein restore-Programm
  
 
 
nextback     6. Backup und Restore     WS 2013/14 - 31





  
  Linux:
  
        restore  -C [-cdHklMvVy] [-b blocksize] [-D filesystem] [-f file] [-F script]
                  [-L limit] [-s fileno] [-T directory]
  
         restore -i [-acdhHklmMNouvVy] [-A file] [-b blocksize] [-f file] [-F  script]
                  [-Q file] [-s fileno] [-T directory]
  
         restore  -P  file  [-acdhHklmMNuvVy]  [-A  file] [-b blocksize] [-f file] 
                  [-F script] [-s fileno] [-T directory] [-X filelist] [ file ... ]
  
         restore -R [-cdHklMNuvVy] [-b blocksize] [-f file] [-F  script]  [-s  fileno]
                  [-T directory]
  
         restore  -r  [-cdHklMNuvVy]  [-b blocksize] [-f file] [-F script] [-s fileno]
                  [-T directory]
  
         restore -t [-cdhHklMNuvVy] [-A file] [-b blocksize] [-f file] [-F script] 
                  [-Q file] [-s fileno] [-T directory] [-X filelist] [ file ... ]
  
         restore  -x [-adchHklmMNouvVy] [-A file] [-b blocksize] [-f file] [-F script]
                  [-Q file] [-s fileno] [-T directory] [-X filelist] [ file ... ]
  
  
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 32





  
  Allgemeine Optionen "restore":
  
     -i      interaktiver Modus
     -r      gesamtes Band zurückspeichern
     -R      wieder aufsetzen eines Restores nach einem Checkpoint
     -t [filename]     Inhaltsverzeichnis  der Files/des Bandes
     -x [filename]     extrakt Files/Directories vom Band
     -c      konvertieren altes Filesystemformat in neues
     -d      Debug-Modus
     -h      extrahiere die aktuelle Directory (kein Baum)
     -m      benutze I-Nodes
     -N      nicht auf Platte Schreiben
     -y      Fragen mit yes beantworten
     -Y      überschreiben von existierenden Files
     -Z      nicht überschreiben von exist. Files
     -v      ausführliches Protokoll
     -a archiv-file   dump-table wirch aus dem Archiv-File
                      genommen und nicht vom Band
     -b blocks   Anzahl der 512-Byte Blöcke im MB-Block
     -f dump-file    MT-Devices/File,  -  Standardeingabe host:/dev/rmt...
     -s skip     übergehe skip Files auf dem Magnetband
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 33





  
  Kommandos für den interaktiven Modus:
  
     ls [directory]       - Directory auf MB anzeigen
     cd directory         - umsetzen des aktuelle Directory auf MB
     pwd                  - Ausgabe des Akutellen Pfades
     add [ filename ]     - File in die Extraktionsmenge aufnehmen
     delete [ filename ]  - File aus der Extraktionsmenge entfernen
     extract              - start restore
     verbose              - ausführliches Protokoll
     help                 - Hilfe
     quit,exit            - Ende
     setmode              - Eigentümer und Zeiten für Directories setzen
     what                 - Ausgabe der Tapeheader-Inforamtionen
  
  
  Beispiele für restore:
  
     /usr/etc/newfs /dev/rxy0g
     /usr/etc/mount /dev/xy0g /mnt
     cd /mnt
     restore r  -f /dev/rmt0
  
     dump 0f - /dev/rxy0g |  (cd /mnt;  restore  xf  -)
  
     restore -i -f /dev/rmt0
     restore -x -f /dev/rmt0 /usr1/unixsoft
     restore -t -f /dev/rmt0
  
 
nextback     6. Backup und Restore     WS 2013/14 - 34





  
  Weitere Restore-Programme
  -------------------------
  
  HP-UX:
      analog restore:
        frecover -r [-hmosvyAFNOX] [-c config] [-f device] [-S skip]
        frecover -R path [-f device]
        frecover -x [-hmosvyAFNOX] [-c config] [-e path] [-f device]
                 [-g graph] [-i path] [-S skip]
        frecover -I path [-vy] [-f device] [-c config]
        frecover -V path [-vy] [-f device] [-c config]
  
      Beispiele:
        fbackup -i /usr -f - | (cd /mnt; frecover -Xrf -)
  
  AIX:
     analog restore:
        restore [-b Blocks] [-f Device] [-q] [-r] [-s SeekBackup]
        [-t |  -T] [-v] [-x [-M]] [[-B] [-h] [-i] [-m] [-R] [-y] |
        [-d] [-X VolumeNumber [-M]]] [File]
  
     Beispiel:
      dd if=/dev/rmt0 bs=51200 | restore -xvqf-
      restore -xvqf- < /dev/rmt0
      restore -xv /home/mike/manual/chap1
      restore -xdv manual
      restore -x -s4
      restore -xs2 -f/dev/rmt0 /home/mike/manual/chap3
 
nextback     6. Backup und Restore     WS 2013/14 - 35





  
  Erstellen von bootbaren Backups
  -------------------------------
  
  AIX:
      mksysb <Magnetbandgerät>
        Kommandos:
           mkszfile
           mksysb /dev/rmt0
  
  HP-UX:
      mkrs [-v] [-q] [-s] [-f rcdev] [-r rootdev] [-m series]
        -q          quick
        -v          verbose
        -s          small fileset
        -f rcdev    Abzugsband
        -r rootdev  abzuziehendes Gerät
        -m series   Maschinentyp
  
  Bemerkung: Dieses Problem steht heute nicht mehr, da die Installationsmedien
  meistens auch als Boot-System für ein Restore-System dienen können.
  (LINUX, Solaris, ...)
  
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 36





  
  Magnetbandprogramme
  -------------------
  
  Steueroperationen:
  
     mt [-f tape-device] command [count]
         command: eof, weof   - write EOF
                  fsf         - forward space file
                  fsr         - forward space record
                  fsf         - back space file
                  bsr         - back space record
                  rewind      - rewind
                  nbsf        - bsf count+1, fsf
                  asf         - rewind, fsf count
                  eom         - goto end of medium
                  erase       - clear tape
                  offline
                  rewoffl     - rewind and unload
                  status      - print status information
         Benutze raw-Devices ohne Rückspulen!!!
  
  Remote MT-Server
  
    rmt [debug-output-file]
            wird gestartet durch rdump und rrestore
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 37





  Weitere Abzugsprogramme
  -----------------------
  
   pax - portable archive exchange
  
     pax [-cimopuvy] [-f archive [-s replstr] [-t device] 
               [pattern...  ]
     pax -r [-cimnopuvy] [-f archive] [-s  replstr] [-t device] 
               [pattern...  ]
     pax -w [-adimuvy] [-b blocking] [-f archive] [-s replstr] 
            [-t device] [-x format] [pathname...]
     pax -rw [-ilmopuvy] [-s replstr] [pathname...] directory
  
   pax liest und schreibt Archive entsprechend Standard (
       Archive/Interchange  File  Format, IEEE  Std. 1003.1-1988
       (POSIX.1)). tar und cpio Format, standard tar.
  
   Einige Optionen:
       -w   Schreibt Files/Directories auf STDOUT
       -r   Lesen Archivfile von STDIN und schreiben auf Platte
       -rw  Durchreichen
       -a   anhängen an ein Archiv
       -c   Komplement eines Pattern
       -i   Interaktives umbenennen von Files
       -l   Link Files wenn möglich 
       -m   Modifikationszeiten setzen
       -o   Orginalowner eines Files erstellen
       -b   blocking
       -f   archive
       -x archiv-format   Archivformat: cpio,tar
nextback     6. Backup und Restore     WS 2013/14 - 38





    Beispiele:
  
         pax -w -f /dev/rmt0 .
  
         mkdir newdir
         cd olddir
         pax -rw . newdir
  
    Äquivalent:     
         ls * | cpio -ocv
         pax  -wdv *
  
         find /dir -type f -print | cpio -oc
         find /dir -type f -print | pax -w -t cpio
  
         cpio -icdum < archive
         pax -r < archive
  
         (cd /from; find . -print) | cpio -pdlum /to
         pax -rw /from /to
  
         tar cf archive *
         pax -w -f archive *
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 39





  
  rsync - faster, flexible replacement for rcp
  
       rsync [OPTION]... SRC [SRC]... [USER@]HOST:DEST
       rsync [OPTION]... [USER@]HOST:SRC DEST
       rsync [OPTION]... SRC [SRC]... DEST
       rsync [OPTION]... [USER@]HOST::SRC [DEST]
       rsync [OPTION]... SRC [SRC]... [USER@]HOST::DEST
       rsync [OPTION]... rsync://[USER@]HOST[:PORT]/SRC [DEST]
  
  Optionen:
      -v, --verbose              increase verbosity
      -q, --quiet                decrease verbosity
      -c, --checksum             always checksum
      -a, --archive              archive mode
      -r, --recursive            recurse into directories
      -R, --relative             use relative path names
      -b, --backup               make backups (default ~ suffix)
          --backup-dir           make backups into this directory
          --suffix=SUFFIX        override backup suffix
      -u, --update               update only (don't overwrite newer files)
      -l, --links                copy symlinks as symlinks
      -L, --copy-links           copy the referent of symlinks
          --copy-unsafe-links    copy links outside the source tree
          --safe-links           ignore links outside the destination tree
      -H, --hard-links           preserve hard links
      -p, --perms                preserve permissions
      -o, --owner                preserve owner (root only)
      -g, --group                preserve group
      -D, --devices              preserve devices (root only)
nextback     6. Backup und Restore     WS 2013/14 - 40





      -t, --times                preserve times
      -S, --sparse               handle sparse files efficiently
      -n, --dry-run              show what would have been transferred
      -W, --whole-file           copy whole files, no incremental checks
          --no-whole-file        turn off --whole-file
      -x, --one-file-system      don't cross filesystem boundaries
      -B, --block-size=SIZE      checksum blocking size (default 700)
      -e, --rsh=COMMAND          specify rsh replacement
      --rsync-path=PATH          specify path to rsync on the remote machine
      -C, --cvs-exclude          auto ignore files in the same way CVS does
          --existing             only update files that already exist
          --ignore-existing      ignore files that already exist on the 
                                 receivin g side
          --delete               delete files that don't exist on the 
                                 sending side
          --delete-excluded      also delete excluded files on the 
                                 receiving side
          --delete-after         delete after transferring, not before
          --ignore-errors        delete even if there are IO errors
          --max-delete=NUM       don't delete more than NUM files
          --partial              keep partially transferred files
          --force                force deletion of directories even if 
                                 not empty
          --numeric-ids          don't map uid/gid values by user/group name
          --timeout=TIME         set IO timeout in seconds
          --timeout=TIME         set IO timeout in seconds
      -I, --ignore-times         don't exclude files that match length and time
          --size-only            only use file size when determining if a 
                                 files hould be transferred
          --modify-window=NUM    Timestamp window (seconds) for file match
nextback     6. Backup und Restore     WS 2013/14 - 41





                                 (default=0)
      -T  --temp-dir=DIR         create temporary files in directory DIR
          --compare-dest=DIR     also compare destination files relative to DIR
      -P                         equivalent to --partial --progress
      -z, --compress             compress file data
          --exclude=PATTERN      exclude files matching PATTERN
          --exclude-from=FILE    exclude patterns listed in FILE
          --include=PATTERN      don't exclude files matching PATTERN
          --include-from=FILE    don't exclude patterns listed in FILE
          --version              print version number
          --daemon               run as a rsync daemon
          --no-detach            do not detach from the parent
          --address=ADDRESS      bind to the specified address
          --config=FILE          specify alternate rsyncd.conf file
          --port=PORT            specify alternate rsyncd port number
          --blocking-io          use blocking IO for the remote shell
          --no-blocking-io       turn off --blocking-io
          --stats                give some file transfer stats
          --progress             show progress during transfer
          --log-format=FORMAT    log file transfers using specified format
          --password-file=FILE   get password from FILE
          --bwlimit=KBPS         limit I/O bandwidth, KBytes per second
          --read-batch=PREFIX    read batch fileset starting with PREFIX
          --write-batch=PREFIX   write batch fileset starting with PREFIX
      -h, --help                 show this help screen
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 42





  
  Beispiele:
  
       # Herstellen einer Sicherheitskopie nach 
       #    Host:  host-save
       #    Directory backup.Work im Homedirectory des Nutzers
       cd /home/Work
       rsync -Cavz . host-save:backup.Work
  
       # get: Kopie holen ins aktuelle Directroy
         rsync -avuzb --exclude '*~' samba:samba/ .
       # put: Kopie des aktuellen Directories schreiben
         rsync -Cavuzb . samba:samba/
  
       rsync *.c shost:src/  # Kopieren von *.c-Files nach shost 
                           # in src/ des aktuellen Nutzers
  
       rsync  -avz shost:src/bar /data/tmp  # Archivmode, alle Files 
                           # von shost:src/bar nach /data/tmp übertragen
                           # bar wird mitkopiert -->  /data/tmp/bar
  
       rsync  -avz shost:src/bar/ /data/tmp  # Archivmode, alle Files 
                           # von shost:src/bar nach /data/tmp
                           # bar wird nicht mitkopiert
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 43





  
     Rechner synchronisieren: bellus nach belluss
  
          #!/bin/sh
          echo bellus-root
          cd /
          echo sync von root
          date
          /usr/bin/rsync -avlHxD  -e ssh --exclude='lost+found/*' \
                        --exclude='etc/fstab'  . root@belluss:/bellusroot/
          cd /usr
          echo sync von usr
          date
          /usr/bin/rsync -avlHx -e ssh --exclude='lost+found/*' \
                --exclude='local' . root@belluss:/bellususr/
          cd /home
          echo sync von home
          date
          /usr/bin/rsync -avlHx  -e ssh --exclude='lost+found/*' \
                                  . root@belluss:/bellushome/
          date
 
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 44





  
      Backup von git nach svn (mit Hard-Links)
  
           #!/bin/sh
           HOST=git
           #
           echo "   `hostname`:/backup/Bin/backup-git"
           echo "           Backup $HOST:/git on '`hostname`'"
           echo "           `date`"
           NR=`cat /backup/Backup-git/COUNT`
           NRN=`expr $NR + 1`
           if [ ! -d /backup/Backup-git/git.$NR ] ; then
              echo "    /backup/Backup-git/git.$NR    existiert nicht!!!!!!!!!!"
              exit
           fi
           for DIR in Bin Data
             do
               echo "                 Sichern /git/$DIR"
               # fuer Test:
               # ssh -c blowfish root@$HOST /usr/bin/ls -lisa /git/$DIR
               # alt
               /opt/csw/bin/rsync -avlHx --delete  -e ssh -c blowfish" \
                                  --link-dest=/backup/Backup-git/git.$NR  
                           root@$HOST:/git/$DIR   /backup/Backup-git/git.$NRN/
           done
           echo "$NRN" > /backup/Backup-git/COUNT
           echo "           Fertig"
           echo "           `date`"
 
 
nextback     6. Backup und Restore     WS 2013/14 - 45





  
     Directories retten mit rsync
  
      #!/bin/sh
      cd 
      SYNCDIR=Sysadmin
      BASEDIR=`pwd`
      if [ $# -ne 1 ] ; then
         echo "usage: $0 <Destination-Host>"
         exit 1
      fi
      HOST=$1
      if [ ! -d $SYNCDIR ] ; then
         echo "Source-Directory  '$SYNCDIR' do not exist"
         exit 2
      fi
      echo -n "Save '`hostname`:$BASEDIR/$SYNCDIR' to \
                             '$USER@$HOST:$SYNCDIR'? [y/n]  "
      read  ANS
      if [ "x$ANS"  != "xy" ] ; then
          echo "No save. Exit!!"
          exit 3
      fi
      echo "Start save with rsync"
      rsync -avlHxD -e ssh  $BASEDIR/$SYNCDIR $USER@$HOST:
  
  
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 46





  
  Backup mit ZFS:  
  
      zfs set mountpoint=/SYSTEM SYSTEM
      # erzeugen FS SYSTEM/DATEN
      zfs create SYSTEM/DATEN  
      # erzeugen FS SYSTEM/DATEN/usr2
      zfs create SYSTEM/DATEN/usr2
      # entfernen des Mountpoints von FS SYSTEM/DATEN
      zfs set mountpoint=legacy SYSTEM/DATEN
      # setzen des Mountpints für SYSTEM/DATEN/usr2
      zfs set mountpoint=/usr2 SYSTEM/DATEN/usr2
      # Quota setzen
      zfs set quota=10GB SYSTEM/DATEN/usr2
      # Snapshot erzeugen (Backup)
      zfs snapshot SYSTEM/DATEN/usr2@snap1
      # Daten stehen jetzt unter /usr2/.zfs/snapshot/snap1 zur Verfügung
      # Achtung ls -lisa /usr2 zeigt .zfs nicht an!!!!
      # snapshots werden bei zfs list angezeigt (ohne Mountpoint)
      # Rueckspeichern der Daten
      zfs rollback SYSTEM/DATEN/usr2@snap1
      # Löschen des Snapshots snap1
      zfs destroy SYSTEM/DATEN/usr2@snap1
  
  Achtung, dies schützt nicht vor Datenträgerausfällen!!!!!
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 47





  Automatische Abzugssysteme
  --------------------------
  
  Leistungen:
  
       Automatisches Backup
       Inkrementelles und Full-Backup
       Verwaltung der Backupmedien
       Zentraler Backupserver
       Clientenverwaltung
       Restore
  
  Freeware
  --------
  
     AMANDA - The Advanced Maryland Automatic Network Disk Archiver
              Verfügbar auf allen UNIX-Systemen, Windows mit Samba
  
  Kommerzielles
  -------------
  
     Legato Networker (Polycenter Networker)
              Verfügbar auf allen UNIX-Systemen, auf allen Windows-Systemen
              Spezielle Module für Datenbanken
  
     TIVOLI/ADSM - Tivoli Storage Manager
             Verfügbar auf allen UNIX-Systemen, auf allen Windows-Systemen
                   
 
 
nextback     6. Backup und Restore     WS 2013/14 - 48





  AMANDA      ab 1991
  ------
  The Advanced Maryland Automatic Network Disk Archiver
  University of Maryland at College Park
     Freeware: http://www.amanda.org/
  
     Hardware: Diverse Magnetbandgeräte
               http://wiki.zmanda.com/index.php/Tapetype_definitions
                    DLT, SDLT, Sony AIT, LTO, DDS, DLT
                    und Tapelibraries
  
  Datensicherung in einem Netzwerk von Unix-Rechnern und neuerdings
  auch von Windows-Rechnern (mittels samba) auf zentrales Bandgerät
  oder in zentrale Library . Benutzt als Backup-Programme tar und dump.
  
  Quellen: http://www.amanda.org/
           letzte  Version : amanda-3.3.4    3.7.2013
  
  Mailinglisten
      amanda-announce@amanda.org
      amanda-users@amanda.org
      amanda-hackers@amanda.org  
         Anmeldung : amanda-announce-request@amanda.org
                     amanda-users-request@amanda.org
                     amanda-hackers-request@amanda.org
                  jeweils:
                    im Mail-Body:  subscribe <meine Mailadresse>
         Archive der Mailinglisten
           http://www.egroups.com/list/amanda/amanda-hackers
           http://www.egroups.com/list/amanda/amanda-users
nextback     6. Backup und Restore     WS 2013/14 - 49





  
  AMANDA ist freie Software (open source) und wird seit Anfang der 90-iger 
  Jahre von einer (mittlerweile weltweiten) community ständig weiterent-
  wickelt.  Demzufolge wird dieses Produkt auch von den unterschiedlichsten
  "Backup-Bedürftigen" eingesetzt, mit einer entsprechenden Rückkopplung 
  zu den Entwicklern.
  
  Charakteristika von AMANDA
  
      * Client-Server-Prinzip
        Im Sinne der Datensicherung heißt dies, es werden Daten von einem
        oder mehreren Rechner(n) zum Zwecke der Sicherung zu einem
        sogenannten Backup-Server kopiert. Zur Wiederherstellung defekter
        Daten werden die entsprechenden Kopien vom Backupserver geholt.
            o server-initiierte Datensicherung
              In dieser Situation ist der Backupserver der Client des zu
              sichernden Rechners (Fileserver), da die Daten geholt werden.
            o clienten-initiierte Datenrekonstruktion
              Nur bei Bedarf der Wiederherstellung defekter Daten
              (zerstört, nicht mehr existent, ...) geht die Initiative vom 
              gesicherten Rechner aus, dem clienten.
  
      * parallele Backups (Datensicherungen) durch Kopieren in einen Cache-
        Speicher. Zum Zwecke der Datensicherung zum Backupserver kopierte 
        Daten werden in einem Platten-Cache zwischengespeichert. Das Schreiben
        auf das endgültige Medium erfolgt unabhängig vom Sicherungsprozess 
        auf dem Backupserver.
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 50





  Positives über AMANDA
  
      * AMANDA steht sowohl server- als auch clienten-seitig für ein breites 
        Spektrum von Betriebssystemplattformen zur Verfügung 
        (UNIXe: Linux, Solaris, HP-UX, ...)
  
      * Windows-Systeme werden als Client unterstützt, wenn das SMB-Protokoll 
        (SAMBA) genutzt werden kann.
  
      * Sicherungskopien sind sowohl im Cache-Speicher direkt (online) nutzbar 
        (zwecks restore) als auch von anderen Medien. Letzteres ist natürlich 
         abhängig vom Medientyp, wie z.B. Bänder.
  
      * Die Backups (Sicherungskopien) werden standardmässig im tar-Format 
        geschrieben, somit wäre im Ernstfall auch ein Zugriff ohne AMANDA 
        möglich.
  
      * Ausgeklügeltes Schedulingsystem zur zeitlichen Planung der vom Backup-
        server initiierten Backups. Dabei werden u.a. folgende Faktoren 
        berücksichtigt:
            o welche Datenmenge ist zu kopieren
            o welche Bandbreite steht zur Verfügung
            o aktuelle Kapazität des Cache-Speichers
            o sind mehrere Filesysteme/Verzeichnisse von einem Clienten zu sichern 
              (Last-Problem)
            o sind zu sichernde Filesysteme/Verzeichnisse eines Clienten physisch 
              auf einer Platte lokalisiert (gleiche Spindel).
  
      * vollständige (full dump) sowie inkrementelle Datensicherung, wobei sich 
        letztere immer am aktuellen full dump orientiert
nextback     6. Backup und Restore     WS 2013/14 - 51





  
      * zeitlich vorgezogene full dumps, wenn der Umfang der inkrementellen 
        Sicherung im Verhältnis zum full dump ungünstig wird (in Abhängigkeit 
        der benötigten Kapazitäten)
  
      * Verwendung unterschiedlicher Kompressionsverfahren, sowohl an Client 
        als auch Server realisierbar
  
      * Das Wiederherstellen von Files (restore) geschieht datumsorientiert. 
        Hierbei "sieht" der Clienten-Administrator das zum Zeitpunkt der 
        Sicherung existierende komplette Verzeichnis und kann somit "aus dem 
        Vollem schöpfen".
  
      * Security-Anforderungen zwischen Client und Server wird AMANDA in zwei 
        Levels gerecht, entweder mit dem sog. BSD-Mechanismus (analog .rhosts) 
        oder mittels Kerberos.
  
  Probleme:
      * vollständige Sicherungen (full dumps) gehen komplett über das Netz
  
      * restore-Operationen sind nur dem Administrator am Clienten erlaubt
  
      * aufwendige Installation/Konfiguration sowohl für Clienten- als auch 
        Serverfunktionalität.  Der Clienten-Aufwand ist jedoch durch 
        vorgefertigte Installationspakete des Serveradministrators auf 
        einen minimalen Aufwand reduzierbar.
  
  
 
 
nextback     6. Backup und Restore     WS 2013/14 - 52





  
  Einsatz bei uns: 1993 bis 1999 (Lehrstuhl Fischer)
  
     Gründe für die Einführung: 
                Preis 
                heterogene Umgebung
                Stabilität
                Support
                Nutzerfreundlichkeit
                Dokumentation
  
     verschiedene Versionen benutzt 2.2.1 2.2.6, (2.3.0)
  
     Anzahl der Backupserver: 1
     Anzahl der Clienten:  14
     Betriebssysteme:   SUNOS, Solaris, HP-UX, DEC-UNIX, Linux
     Abzugsgerät: DAT-Magnetbandgerät (4/8 GB)
     Kapazität: 15-20 GB
     Funktion: arbeitstägliche Sicherung und Langzeitarchivierung  
  
     Gründe für die Ablösung:
          Kapazitätsprobleme
          Preise für neue Hardware
          Einführung von ADSM durch das CMS
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 53





  Aufbau und Arbeitsweise
  -----------------------
  1. Amanda-Server mit Server-Software, Bandgerät, 
     optionale holding-disk
  2. Amanda-Clients mit Client-Software 
  
  Für uns wichtige positive Eigenschaften
  - benutzt eigenes Netzwerkprotokoll, keine Sicherheitsprobleme
    wie rmt
  - unterstützt viele Backup-Geräte einschließlich Stacker und Jukeboxen
  - unterstützt vollständiges und inkrementelles Backup
  - Schutz gegen versehentliches Überschreiben von Medien
  - benutzt dump / restore, GNU-tar
  - Prüfung vor Dump möglich (korrektes Band, Netzwerk)
  - berechnet notwendige Dumplevel nach Vorgaben und Bandgröße
  - Komprimierung vor Netztransport möglich
  - bei Bandfehler erfolgt Sicherung auf holding-disk
  - Pufferung der Daten auf Pufferplatten möglich
  - speichert erfolgte Sicherungen zum Wiederauffinden 
  - restore auch ohne AMANDA möglich
  - gesteuert durch einfache Kommandos und Konfigurationsdateien
  - man-pages
  
  Negative Eigenschaften
  - keine grafische Oberfläche
  - Backup-Archiv nicht über mehrere Bänder verteilbar
  - Backup-Archiv nicht größer als ein Magnetband
  - nur ein Backup-Server unterstützt
 
 
nextback     6. Backup und Restore     WS 2013/14 - 54





  
  Arbeitsweise von Amanda
  
  Strategie:
  
    1.  Vollständiger Abzug innerhalb eines vorgegebenen Zyklus,
        an jedem Tag wird ein Teil des Full-Backups abgespeichert.
    2.  Täglicher, inkrementeller Abzug der Daten zwischen den 
        vollständigen Abzügen
  
   Dadurch läßt sich die Menge der täglich zu sichernden Daten
   konstant halten, wenn die täglichen Änderungen gleichmäßig
   über den Zyklus verteil sind. Der Zyklus ist je nach Rechner
   frei wählbar.
  
     tägliche Abzugsmenge = Gesamtmenge/Zyklustage + 
                            Tägliche Änderung * (Zyklustage - 1)
  
   z.B. 100 GByte Daten, bei 10% täglicher Änderung
     3-Tage Zyklus:    100 GB / 3 +  100*0.1 (3-1) = 33+10*2 = 53 GB
     d.h. das MB muß 53 GByte fassen.
 
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 55





  
  Programme:
     
     Server-Programme:
  
        amdump     - Kommunikationsprogramm zu amandad, startet das Backup
        amtape     - Führt Steueroperationen für Tapechanger aus
        amverify   - Prüfen von Bändern
        amrmtape   - Löschen von Bändern aus dem Index
        ammt       - Bandsteuerung
        amindexd   - Zugriff über Index   - Daemon
        amidxtaped - Zugriff über Index   - Daemon
  
     Client-Programme:
  
        amandad    - organisiert die Datenübertragung
        amrestore  - Rückspeichern
        amrecover  - Rückspeichern von Dateien, interaktiv, geht über Index
        amfetchdump- Zusammensammeln von Backups von mehreren Bändern
 
 
 
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 56





  
     Administrations-Programme:
  
        amcheck    - Überprüfung der Konfiguration (lokal und remote)
        amlabel    - Band labeln
        amcleanup  - nach Systemabsturz aufräumen
        amadmin    - Administrationsaufgaben
        amstatus   - Status anzeigen
        amoverview - Anzeigen des Statuses der Hosts
        amflush    - Löschen der Holding-Disk
        amreport   - Erzeugen von AMANDA-Mails
        amtoc      - Erzeugen von content-Files für AMANDA-Bänder
        amcheckdb  - Konsistenzprüfung der AMANDA-Datenbank
        amgetconf  - Anschauen Konfiguration
        amtapetype - Erzeugen einer Gerätedefinition
        amaespipe
        amcrypt
 
 
 
 
 
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 57





  AMANDA installieren
  -------------------
  1. Es steht als fertiges Softwarepaket für viele Systeme zur Verfügung.
  
       Linux   - SuSE 12.1:   zypper install amanda  (3.3.0)
       Solaris - Opencsw:     pkg-get install amanda  (3.3.1)
  
     Wichtige Configurationsinformationen abfragen:
       /usr/sbin/amadmin xx version | grep CLIENT_LOGIN
            LIENT_LOGIN="amanda" CHECK_USERID HAVE_GZIP
       /usr/sbin/amadmin xx version | grep CONFIG_DIR
            AMANDA_DBGDIR="/tmp/amanda" CONFIG_DIR="/etc/amanda"
       /usr/sbin/amadmin xx version | grep AMANDA_DBGDIR
            AMANDA_DBGDIR="/tmp/amanda" CONFIG_DIR="/etc/amanda"
       /usr/sbin/amadmin xx version | grep libexecdir
            libexecdir="/usr/lib" amlibexecdir="/usr/lib/amanda"
       /usr/sbin/amadmin xx version | grep listed_incr_dir
            listed_incr_dir="/var/lib/amanda/gnutar-lists"
  
  2. Installieren von den Quellen
  
       http://sourceforge.net/projects/amanda/files
  
       gtar -zxvf amanda-3.3.2.tar.gz
       ./configure
       make
       make install
  
       Die Files werden unter /usr/local/bin, /usr/local/man, /usr/local/sbin, ...
       installiert.
nextback     6. Backup und Restore     WS 2013/14 - 58





  Konfiguration von AMANDA
  ------------------------
  Server und Clienten müssen getrennt konfiguriert werden.
  
  Konfigurationsdateien (nur auf dem Server):
     nur 2 Konfiguratonsdateien - nur auf dem Server
                amanda.conf und disklist 
         stehen unter /usr/local/etc/amanda/<projekt> oder /etc/amanda/<projekt>
  
     disklist - Beschreibt die zu sichernden Filesysteme auf den
                einzelnen Rechnern
   
       z.B.
        #       hostname diskdev dumptype
        # OSF1 
        delta           /usr2   KURZ-high 
        delta           /usr3   KURZ-high 
        # spurtefix - holding-disk  
        spurtefix       /home    hold-disk 
  
           wobei dumptype's in amanda.conf definiert werden:
                 define dumptype hold-disk {
                    comment "The master-host holding disk itself"
                    options no-hold, no-compress
                    priority medium
                 }
  
        weitere default dumptypes: skip-full, skip-incr,user-tar, root-tar 
        sind in amanda.conf beschrieben
 
nextback     6. Backup und Restore     WS 2013/14 - 59





     amanda.conf - Allgemeines Konfigurationsfile
         Ausschnitt:              
            org         "test"    # Name
            mailto      "amanda"  # Mailadresse für Nachrichten
            dumpuser    "amanda"  # the user to run dumps under
            # printer   "tlabels" # Tape label printer
            inparallel   2        # maximum dumpers that will run in parallel
            netusage    800  Kbps # maximum net bandwidth for Amanda, in KB per sec
            dumpcycle   4 weeks   # the number of days in the normal dump cycle
            runspercycle   5      # the number of amdump runs in dumpcycle days
            tapecycle   5 tapes   # the number of tapes in rotation
            bumpsize   200 MB     # minimum savings (threshold) to bump level 1 -> 2
            bumpdays       1      # minimum days at each level
            bumpmult       4      # threshold = bumpsize * (level-1)**bumpmult
            runtapes       1      # number of tapes for a single run
            tapedev "/dev/nrst1"    
            tapetype WANGDAT      # what kind of tape 
            labelstr "^VOL[0-9][0-9]*$"     
            diskdir "/home/tmp"     # where the holding disk 
            disksize 497 MB         # how much space can we use on it
            infofile "/home/AMANDA-2.2.6/informatik.hu-berlin.de/curinfo" 
                                       # database filename
            logdir   "/home/AMANDA-2.2.6/informatik.hu-berlin.de/log"  
                                       # log filename
            define tapetype WANGDAT {
                comment "WANGDAT tape drives"
                length 7000 mbytes
                filemark 100 kbytes         
                speed 600 kbytes
            }
nextback     6. Backup und Restore     WS 2013/14 - 60





  AMANDA  Server einrichten (test)
  --------------------------------
  
  Der Server sollte über mindestens ein Bandlaufwerk und genügend 
  Plattenkapazität verfügen. Alternativ kann bei genügend Platten-
  kapazität mit virtuellen Bändern gearbeitet werden.
  
  AMANDA läuft normalerweise unter einem normalen Nutzer (nicht privilegiert).
  
  1. amanda-Nutzer einrichten.
       Gruppe: amanda
          amanda:!:111:
       Nutzer: amanda
          amanda:!:37:111:Amanda admin:/var/lib/amanda:/bin/bash
     mit Zugriff auf alle AMANDA-Programme (Installationspfad beachten)
     mkdir /tmp/amanda     # temp. Dateien, Debug-Logs
     chown amanda:amanda /tmp/amanda
  
  2. Konfigurationsname festlegen
  
     Dieser Name beschreibt eine Menge von Abzügen.
  
     mkdir -p /etc/amanda/test  # configurationsdirectory "test"
  
     In diesem Direktory müssen alle Konfigurationsfiles für die 
     Konfiguration "test" dann abgelegt werden.
  
     mkdir -p /home/space          # viel Platz für amanda
                                   # Holdingdisks eventuell, viruelle Tapes
     mkdir -p /var/lib/amanda/test # 2.Teil Konfiguration
nextback     6. Backup und Restore     WS 2013/14 - 61





  
  3. Zugriffsrechte setzen
  
       chown amanda:amanda /etc/amanda/test /home/space/test /var/lib/amanda/test
       su - amanda
       touch /etc/amanda/test/tapelist
       mkdir -p /var/lib/amanda/test/index
       mkdir -p /var/lib/amanda/test/logs
       mkdir -p /var/lib/amanda/test/curinfos
       # Muster für Konfigurationsfile holen
       cp /etc/amanda/example/amanda.conf /etc/amanda/test/amanda.conf
  
  4. Konfigurieren
  
       Modifizieren von /etc/amanda/test/amanda.conf
  
          logdir   "/var/lib/amanda/test/logs"       # log directory
          infofile "/var/lib/amanda/test/curinfo"    # database filename
          indexdir "/var/lib/amanda/test/index"      # index directory
          tapelist "/etc/amanda/test/tapelist"       # list of used tapes
  
          holdingdisk hd1 {
                 directory "/home/space/amandahold/test"
          }
  
       mkdir -p /home/space/amandahold/test
       chown amanda:amanda /home/space/amandahold/test
  
 
 
nextback     6. Backup und Restore     WS 2013/14 - 62





      Modifizieren von /etc/services
         amanda       10080/tcp
         amanda       10080/udp
         amandaidx    10082/tcp
         amandaidx    10082/udp
         amidxtape    10083/tcp
         amidxtape    10083/udp
  
     Modifizieren von /etc/inetd.conf bei "inetd"
        amanda    stream  tcp wait   amanda  /usr/lib/amanda/amandad \
                                 amdump amindexd noop selfcheck amidxtaped \
                                 sendsize sendbackup
        amandaidx stream tcp nowait amanda /usr/lib/amanda/amindexd amindexd
        amidxtape stream tcp nowait amanda /usr/lib/amanda/amidxtaped amidxtaped
  
  oder bei xinetd foldende Files modifizieren:
    /etc/xinetd.d/amanda    (client)
       #       server_args     = -auth=bsdudp amdump
       service amanda 
       {
            socket_type     = stream
            protocol        = tcp
            wait            = no
            user            = amanda
            group           = amanda
            server          = /usr/lib/amanda/amandad
            disable         = no
            server_args     = amdump amindexd noop selfcheck amidxtaped sendsize sendbackup
       }
 
nextback     6. Backup und Restore     WS 2013/14 - 63





  
    /etc/xinetd.d/amandaidx   (server)
       #
       service amandaidx
       {
            socket_type     = stream
            protocol        = tcp
            wait            = no 
            user            = amanda
            group           = amanda
            server          = /usr/lib/amanda/amindexd
            disable         = no
       }
  
    /etc/xinetd.d/amidxtape  (server)
       service amidxtape
       {
            socket_type     = stream
            protocol        = tcp
            wait            = no 
            user            = amanda
            group           = amanda
            server          = /usr/lib/amanda/amidxtaped
            disable         = no
       }
  
  
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 64





  
   Disklist erstellen (abzuziehende Filesysteme)
  
        /etc/amanda/test/disklist 
             # Hostname  Filesystem          Dumptype (aus amanda.conf)
             client      /home/bell/Sysadmin comp-user-tar
             client      /home/bell/Tools    comp-user-tar
  
    crontab für amanda einrichten:
  
        0 16 * * 1-5 /usr/sbin/amcheck test
        45 0 * * 2-6 /usr/sbin/amdump test
  
    /var/lib/amanda/.amandahosts
          # für das login vom Clienten
          client         amanda  amindexd amidxtaped amdump
          client.domain  amanda  amindexd amidxtaped amdump
          localhost         amanda  amindexd amidxtaped amdump
          localhost.domain  amanda  amindexd amidxtaped amdump
 
 
 
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 65





     
      Jetzt nur noch die Magnetbandgeräte konfigurieren.
      Problem, wir haben keine Tapedevices mehr!!!!
      Wir simmulieren Tapes über Filesystem
  
      Konfigurationsfile /etc/amanda/test/amanda.conf wie folgt ändern:
  
         dumpcycle 5
         runspercycle 3
         tapecycle 5
         tpchanger "chg-disk:/home/space/vtapes"        # a virtual tape changer
         labelstr "TEST-.*"
         #label_new_tapes "TEST-%%"
         tapetype DVD_SIZED_DISK
  
         define dumptype comp-user-tar {
              user-tar
              compress client fast
         }
  
         define tapetype DVD_SIZED_DISK {
               filemark 4 KB
               length  512 MB
         }
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 66





  
      Vorbereiten der vtapes
  
         mkdir -p /home/space/vtapes
         chown amanda:amanda /home/space/vtapes
         chmod 750 /home/space/vtapes
         # fünf virtuelle Tapes erzeugen
         cd /home/space/vtapes
         su amanda
         ../createvtapes.sh test TEST-
         # von Hand:
         #   for i in 1 2 3 4 5; do mkdir slot$i; done
         #   Labeln der Bänder
         #   for i in 1 2 3 4 5; do amlabel test TEST-$i slot $i; done
         # virtuellen tape-changer initialisieren
         #
         ln -s slot1 data  # geladenes virtuelles Band
         # prüfen der virtuellen Bänder
         amdevcheck test  file:/home/space/vtapes
         amtape test reset
  
 
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 67





  
      Entfernen der virtuellen Bänder:
   
           rm -rf /home/space/vtapes/slot*
           rm -rf /home/space/vtapes/data
           rm -rf /home/space/amandahold/test/*
           rm -rf /var/lib/amanda/test/*
           mkdir -p /var/lib/amanda/test/logs
           cp /dev/null  /etc/amanda/test/tapelist
          
          Danach wieder neu einrichten, wie oben.
    
  
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 68





  AMANDA-Client einrichten:
  ------------------------.
  
      amanda-user anzeigen lassen:
          /usr/sbin/amadmin xx version | grep CLIENT_LOGIN
              CLIENT_LOGIN="amanda"
  
      amanda-user  einrichten (/var/lib/amanda - Homedir)
  
      amanda-Konfigurations-Dir anzeigen lassen
          /usr/sbin/amadmin xx version | grep CONFIG_DIR
              CONFIG_DIR="/etc/amanda"
  
      /etc/services:
  
             amanda       10080/udp
             amanda       10080/tcp
  
      /etc/inetd.conf:
  
        amanda    dgram  udp wait   amanda  /usr/lib/amanda/amandad \
                                           amindexd noop selfcheck amidxtaped \
                                           sendsize sendbackup
     xinetd.d/amanda wie bei server
  
      /var/lib/amanda/.amandahosts:
  
            clienthost        root amanda amindexd amidxtaped
            clienthost.domain root amanda amindexd amidxtaped
 
nextback     6. Backup und Restore     WS 2013/14 - 69





  
  Jetzt können wir einen Test fahren:
  ----------------------------------
  Firewall ausschalten!!! IPv4 ist von Vorteil!!!!
     Abzug auf dem Server (als amanda):
  
             su - amanda
             /usr/sbin/amcheck  test
             /usr/sbin/amdump test
            ls -lisa /home/space/vtapes/slot1
  
     Rückspeichern auf dem Clienten (als root)
  
           cd /tmp/Restore
           amrecover  test
           amrecover> help
           amrecover> sethost localhost
           amrecover> setdisk /home/bell/Tools
           amrecover> ls
           amrecover> cd Make/m1
           amrecover> pwd
           amrecover> add Makefile
           amrecover> extract
           amrecover> quit
  
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 70





  Kurze übersicht über wichtige AMANDA-Befehle 
  --------------------------------------------
  
  amlabel  - Band labeln
  
    amlabel test  TEST-1 slot 1
  
  amcheck  - Band ok, Rechner erreichbar, opt. mail
  
    amcheck  test
  
      Amanda Tape Server Host Check
      -----------------------------
      Holding disk /home/space/amandahold/test: 64520192 kB disk space 
                                                   available, using 64520192 kB
      slot 1: volume 'TEST-1' is still active and cannot be overwritten
      slot 2: volume 'TEST-2'
      Will write to volume 'TEST-2' in slot 2.
      NOTE: skipping tape-writable test
      Server check took 0.166 seconds
  
      Amanda Backup Client Hosts Check
      --------------------------------
      Client check: 1 host checked in 1.025 seconds.  0 problems found.
  
      (brought to you by Amanda 3.3.3)
  
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 71





  
  amdump - Sicherung durchführen
  
    in crontab:
        0 16 * * 1-5 /usr/sbin/amcheck -m test
        45 0 * * 2-6 /usr/sbin/amdump test
  
  amadmin - Administrierung
  
     amadmin test find localhost
  
       date       host      disk                lv tape or file file part status
       2009-11-13 localhost /home/bell/Sysadmin  0 TEST-1          2   -- OK
       2009-11-13 localhost /home/bell/Tools     0 TEST-1          1   -- OK
  
  amrestore
  
     amrestore -p /dev/rst1 delta /usr2 |restore -if -
  
  amflush - löschen von Abzügen
  
     amflush informatik.hu-berlin.de 
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 72





  
  amrecover - Rückspeichern von Daten  (als root)
  
     cd /tmp/Restore
  
     amrecover  test
     amrecover> help                       - Hilfe
     amrecover> sethost localhost          - Host spezifizieren
     amrecover> setdisk /home/bell/Tools   - Einstellen des Abzuges
     amrecover> ls                         - ls vom Tape
     amrecover> cd Make/m1
     amrecover> pwd
     amrecover> add Makefile               - add to extraction list
     amrecover> extract                    - Rückspeichern
     amrecover> quit
  
     sethost - setzen des Hosts
     clear   - Löschen der Extraktionsliste
     delete  - Löschen eines Eintrages von der Extraktionsliste
     lcd     - change local directory
     lpwd    - Anzeigen local directory-path
     listdisk - Anzeigen aller Platten
     
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 73





  
  amtape - Ausführen von Steueroperation für Bandwechselgeäte
  
     reset, eject, clean, show, taper, device, current
  
        amtape test show
           amtape: scanning all 5 slots in changer:
           slot   1: date 20131118161249 label TEST-1
           slot   2: date X              label TEST-2
           slot   3: date X              label TEST-3
           slot   4: date X              label TEST-4
           slot   5: date X              label TEST-5
  
        amtape test current
           slot   2: time X              label TEST-2
           changed to slot 2
  
 
 
 
 
 
 
 
 
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 74





    Benachrichtigung per Mail:
  
      These dumps were to tape VOL01.
      Tonight's dumps should go onto tape VOL02 or a new tape.
      FAILURE AND STRANGE DUMP SUMMARY:
        marita     /usr lev 0 FAILED [could not connect to marita]
      STATISTICS:
                                Total       Full      Daily
                              --------   --------   --------
      Dump Time (hrs:min)        3:06       2:18       0:15   
      Output Size (meg)        5083.7     4534.9      548.8
      Original Size (meg)      5083.7     4534.9      548.8
      Avg Compressed Size (%)     --         --         -- 
      Tape Used (%)              72.6       64.8        7.9   
      Filesystems Dumped           18          9          9   
      Avg Dump Rate (k/s)       535.4      561.7      386.1
      Avg Tp Write Rate (k/s)   566.6      561.2      615.2
      NOTES:
        driver: WARNING: /home/tmp: 508928 KB requested, but only 501704 KB available.
        planner: Request to marita timed out.
        planner: Could not get estimate for marita:/usr, using historical data.
        planner: Full dump of idefix:/usr promoted from 1 days ahead.
      DUMP SUMMARY:
        HOSTNAME   DISK      L  ORIG-KB   OUT-KB  COMP%  MMM:SS   KB/s  MMM:SS   KB/s
        ----------------------  --------------------------------------  -------------
        delta      /usr2     1    76992    76992    --     5:48  221.1    1:59  648.6
        delta      /usr3     1    47642    47642    --     3:36  220.2    0:51  932.8
        fanta      /         0  1516552  1516552    --    42:42  592.0   42:42  592.0
        idefix     /usr      0   198176   198176    --     6:21  519.5    6:22  518.4
 
nextback     6. Backup und Restore     WS 2013/14 - 75





  Kommerzielle Software
  ---------------------
  
     sehr teuer !!!!!!!! - 5 stelliger Euro-Betrag
  
  Anforderungen:
  
    - Backupsize mit beliebiger Länge
    - Eigenschaften der Dateien müssen gespeichert werden
    - Exclude Funktion für Dateien und Directories
    - Automatisierte Backup-Sheduling
    - Standardeinstellungen für Backup und Restore
    - Unterstützung von ACL's
    - Remote Backup und Restore
    - mehrere Backup-Server
    - Unterstützung von Stackern, Jukeboxen und Libraries
    - RAID-Bandgeräte-Unterstützung zum parallelen Schreiben
    - Pufferspeicher auf Festplatten (Cache)
    - Multiplexbetrieb für mehre Backup- und Restore-Streams
    - Alle Betriebssystem müssen unterstützt werden
    - Betriebssystem unabhängige Speicherung
    - Archivierung muß unterstützt werden
    - Datenbank für die Verwaltung der Medien und Dateien
    - Abzug von Datenbanken
  
 
 
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 76





  
  POLYCENTER NetWorker Save and Restore (Legato Networker)
  --------------------------------------------------------
  
     Verfügbar auf:
            DEC-UNIX, SunOS, Solaris, AIX, IRIX
  
   Kommandos:
     nsr_ize      - Softwareinstallation
     nwadmin, nsradmin, nsrwatch  - Managment
     nsrmm        - Medien-Managment
     nwbackup     - Backup
     nwrecover    - Restore
     nsrjb        - Jukebox-Manager
     mminfo       - Informationsprogramm
     nsr_shutdown - Stop
  
   Server:
     nsrd       - Main daemon
     ansrd      - Copy of nsrd for work
     nsrindexd  - Server für die Verwaltung des Online-Indexes
     nsrmmdbd   - Server für die Verwaltung des Media-Indexes
     nsrmmd     - Server für Client
     nsrim      - Online-Index
     nsrchk     - Prüfen Online-Index
  
   gibt es noch, aber bei uns seit 1999 nicht mehr genutzt.
 
 
 
nextback     6. Backup und Restore     WS 2013/14 - 77





  
  ADSM - ADSTAR Distributed Storage Manager
  Tivoli Storage Manager
  ----------------------------------------------
  
  Client/Server Abzugssystem für Backup und Archivierung
  Kommandozeilenorientierte und graphische Oberfläche
  Abzugsserver unterstützt alle gängigen Librarys
  
     graphische Oberfläche: dsm, dsmj
     Kommandozeile: dsmc
  
  Konfigurationsfiles für Clienten
  --------------------------------
  
  dsm.opt:
  
      ****************************************************************
      * Tivoli Storage Manager                                       *
      ****************************************************************
      *  This file contains an option you can use to specify the TSM
      *  server to contact if more than one is defined in your client
      *  system options file (dsm.sys).  Copy dsm.opt.smp to dsm.opt.
      *  If you enter a server name for the option below, remove the
      *  leading asterisk (*).
      ****************************************************************
      SErvername         deneb
      subdir             yes
 
 
nextback     6. Backup und Restore     WS 2013/14 - 78





  dsm.sys:
      *******************************************************************
      * Tivoli Storage Manager                                          *
      *******************************************************************
      *  This file contains the minimum options required to get started
      *  using TSM.  Copy dsm.sys.smp to dsm.sys.  In the dsm.sys file,
      *  enter the appropriate values for each option listed below and
      *  remove the leading asterisk (*) for each one.
      *  If your client node communicates with multiple TSM servers, be
      *  sure to add a stanza, beginning with the SERVERNAME option, for
      *  each additional server.
      *******************************************************************
      SErvername  deneb
         COMMmethod         TCPip
         TCPPort            1500
         TCPServeraddress   deneb1.informatik.hu-berlin.de
         nodename           bellus1_informatik
         PASSWORDAccess     generate
         ERRORLOGName       /var/tmp/dsmerror.log
         ERRORLOGRetention  8 S
         INCLExcl           /etc/adsm/inclexcl
  
  /etc/adsm/inclexcl:
      exclude.fs    /tmp
      exclude.fs    /var/run
      exclude.dir   /usr/tmp
      exclude.dir   /.../.netscape/cache
      exclude.dir   /.../cache
      exclude       /var/tmp/dsmc.backup
      exclude       /.../core
nextback     6. Backup und Restore     WS 2013/14 - 79





  
     Script zum Starten eines Abzuges
  
          #!/bin/sh
          echo auf `hostname`
          grep SErvername /usr/bin/dsm.sys
          #
          #   hier passiert der Abzug
          #
          /bin/dsmc incremental > /var/tmp/dsmc.backup
          #
          #  hier wird nur noch das Protokoll verdichtet
          #
          for i in / /var  /home
          do
             x=$i
             r=`egrep -e "ANS1802E"\|"Successful" /var/tmp/dsmc.backup | grep backup | grep \'$x\'`
             if [ "x$r" = "x" ] ; then
                echo "$i - error !!!!!!!!!!!!"
             else
                echo $i - successfull
                echo $r | grep ANS1802E
             fi
          done
          /usr/bin/grep "ANS....E" /var/tmp/dsmc.backup
          /usr/bin/tail -15 /var/tmp/dsmc.backup
 
 
 
 
back          6. Backup und Restore     WS 2013/14 - 80

Zurück zur Gliederung
Wed Dec 4 11:10:16 CET 2013 J-P Bell