Changes between Version 17 and Version 18 of Documentation


Ignore:
Timestamp:
Feb 1, 2011, 12:32:06 PM (9 years ago)
Author:
Bruno Cornec
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation

    v17 v18  
    170170
    171171= Backup =
     172
     173Here is an example script of mondoarchive encapsulation for NFS backup:
     174{{{
     175#!/bin/bash
     176
     177# better to got those locally
     178TEMP_PATH=/usr/local/backupmondo/temp
     179SCRATCH_PATH=/usr/local/backupmondo/scratch
     180
     181NFS_HOST=x.y.z.t
     182NFS_MOUNT=/dploy/mondo
     183MOUNT_PATH=/mnt/backupmondo
     184
     185# Relative path that will be used locally and remotely on the NFS server
     186BCKUP_PATH=images
     187
     188if (! test `mount | grep $MOUNT_PATH | wc -l` -eq 0);
     189  then umount $MOUNT_PATH;
     190fi
     191
     192if (! test -d $TEMP_PATH);
     193  then mkdir -p $TEMP_PATH;
     194fi
     195echo "Temp directory $TEMP_PATH created"
     196
     197if (! test -d $SCRATCH_PATH);
     198  then mkdir -p $SCRATCH_PATH;
     199fi
     200echo "Scratch directory $SCRATCH_PATH created"
     201
     202if (! test -d $MOUNT_PATH);
     203  then mkdir -p $MOUNT_PATH;
     204fi
     205echo "Mount directory $MOUNT_PATH created"
     206
     207echo "Try to mount NFS point $NFS_HOST:$NFS_MOUNT on $MOUNT_PATH..."
     208
     209mount ${NFS_HOST}:$NFS_MOUNT $MOUNT_PATH
     210echo "NFS point ${NFS_HOST}:$NFS_MOUNT mounted on $MOUNT_PATH"
     211
     212if (! test -d $MOUNT_PATH/$BCKUP_PATH);
     213  then mkdir -p $MOUNT_PATH/$BCKUP_PATH;
     214fi
     215echo "Backup directory $MOUNT_PATH/$BCKUP_PATH created"
     216
     217BCKUP_NAME=`hostname -s`"-"`date +%Y%m%d%H%M`
     218echo "Backup name: "$BCKUP_NAME
     219
     220CMD_LINE="mondoarchive -O -n $NFS_HOST:$NFS_MOUNT -p $BCKUP_NAME -N -d $BCKUP_PATH -s 4380m -S $SCRATCH_PATH -T $TEMP_PATH -E /tmp"
     221echo "Will run command: $CMD_LINE"
     222
     223$CMD_LINE
     224echo "Mondorescue terminated"
     225
     226umount $MOUNT_PATH
     227echo "Backup directory $MOUNT_PATH unmounted"
     228
     229rm -rf $TEMP_PATH
     230echo "Temp directory $TEMP_PATH removed"
     231
     232
     233rm -rf $SCRATCH_PATH
     234echo "Scratch directory $SCRATCH_PATH removed"
     235
     236echo "Backup over"
     237}}}
    172238= Restoration =
    173239
     
    181247They are used to respectively launch a script just before launching mondorestore, and after its execution.
    182248
    183 [http://essay-for.me/ online essays]
    184249
    185250The main goal is to allow for the pre option to configure for example the HDD layout differently, and to re-configure the systems (static IP address e.g.) for the post option.