"Fossies" - the Fresh Open Source Software Archive

Member "backup2l-1.5/first-time.conf" (13 Dec 2009, 13085 Bytes) of package /linux/privat/backup2l_1.5.tar.gz:


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

    1 ##################################################
    2 # Configuration file for backup2l                #
    3 ##################################################
    4 
    5 
    6 # Define the backup2l version for which the configuration file is written.
    7 # This way, future versions can automatically warn if the syntax has changed.
    8 FOR_VERSION=1.5
    9 
   10 
   11 ##################################################
   12 # Volume identification
   13 
   14 # This is the prefix for all output files;
   15 # multiple volumes can be handled by using different configuration files
   16 VOLNAME="all"
   17 
   18 
   19 
   20 ##################################################
   21 # Source files
   22 
   23 # List of directories to make backups of.
   24 # All paths MUST be absolute and start with a '/'!
   25 SRCLIST=(/etc /root /home /var/mail /usr/local)
   26 
   27 # The following expression specifies the files not to be archived.
   28 # See the find(1) man page for further info. It is discouraged to
   29 # use anything different from conditions (e. g. actions) as it may have
   30 # unforeseeable side effects.
   31 
   32 # This example skips all files and directories with a path name containing
   33 # '.nobackup' and all .o files:
   34 SKIPCOND=(-path "*.nobackup*" -o -name "*.o")
   35 
   36 # Some background on 'SKIPCOND': The method of using a find(1) expression to determine
   37 # files to backup or to skip is very powerful. Some of the following examples result from feature
   38 # requests by various users who were not always aware that their "feature" was already implemented. ;-)
   39 #
   40 # If you want to exclude several directories use the following expression:
   41 #   SKIPCOND=(-path '/path1' -o -path '/path1/*' -o -path '/path2' -o -path '/path2/*')
   42 #
   43 # If you do not have anything to skip, use:
   44 #   SKIPCOND=(-false)     # "SKIPCOND=()" does not work
   45 #
   46 # To skip directory trees (for performance reasons) you can add the '-prune' action to your SKIPCOND setting, e.g.:
   47 #   SKIPCOND=( -name "unimportant_dir" -prune )
   48 #
   49 # To prevent backup2l from crossing filesystem boundaries you can add '-xdev' to your SKIPCOND setting.
   50 
   51 
   52 
   53 
   54 ##################################################
   55 # Destination
   56 
   57 # Mount point of backup device (optional)
   58 #BACKUP_DEV="/disk2"
   59 
   60 # Destination directory for backups;
   61 # it must exist and must not be the top-level of BACKUP_DEV
   62 BACKUP_DIR="/disk2/backup"
   63 
   64 
   65 
   66 ##################################################
   67 # Backup parameters
   68 
   69 # Number of levels of differential backups (1..9)
   70 MAX_LEVEL=3
   71 
   72 # Maximum number of differential backups per level (1..9)
   73 MAX_PER_LEVEL=8
   74 
   75 # Maximum number of full backups (1..8)
   76 MAX_FULL=2
   77 
   78 # For differential backups: number of generations to keep per level;
   79 # old backups are removed such that at least GENERATIONS * MAX_PER_LEVEL
   80 # recent versions are still available for the respective level
   81 GENERATIONS=1
   82 
   83 # If the following variable is 1, a check file is automatically generated
   84 CREATE_CHECK_FILE=1
   85 
   86 
   87 
   88 ##################################################
   89 # Pre-/Post-backup functions
   90 
   91 # This user-defined bash function is executed before a backup is made
   92 PRE_BACKUP ()
   93 {
   94     echo "  pre-backup: nothing to do"
   95 
   96     # e. g., shut down some mail/db servers if their files are to be backup'ed
   97 
   98     # On a Debian system, the following statements dump a machine-readable list of
   99     # all installed packages to a file.
  100     #echo "  writing dpkg selections to /root/dpkg-selections.log..."
  101     #dpkg --get-selections | diff - /root/dpkg-selections.log > /dev/null || dpkg --get-selections > /root/dpkg-selections.log
  102 }
  103 
  104 # This user-defined bash function is executed after a backup is made
  105 POST_BACKUP ()
  106 {
  107     # e. g., restart some mail/db server if its files are to be backup'ed
  108     echo "  post-backup: nothing to do"
  109 }
  110 
  111 
  112 
  113 ##################################################
  114 # Misc.
  115 
  116 # Create a backup when invoked without arguments?
  117 AUTORUN=0
  118 
  119 # Size units
  120 SIZE_UNITS=""    # set to "B", "K", "M" or "G" to obtain unified units in summary list
  121 
  122 # Remove this line after the setup is finished.
  123 UNCONFIGURED=1
  124 
  125 # Archive driver for new backups (optional, default = "DRIVER_TAR_GZ")
  126 # CREATE_DRIVER="DRIVER_MY_AFIOZ"
  127 
  128 
  129 
  130 ##################################################
  131 # User-defined archive drivers (optional)
  132 
  133 # This section demonstrates how user-defined archive drivers can be added.
  134 # The example shows a modified version of the "afioz" driver with some additional parameters
  135 # one may want to pass to afio in order to tune the speed, archive size etc. .
  136 # An archive driver consists of a bash function named
  137 # "DRIVER_<your-driver-name>" implementing the (sometimes simple) operations "-test", "-suffix",
  138 # "-create", "-toc", and "-extract".
  139 
  140 # If you do not want to write your own archive driver, you can remove the remainder of this file.
  141 
  142 # USER_DRIVER_LIST="DRIVER_MY_AFIOZ"  # uncomment to register the driver(s) below (optional)
  143 
  144 DRIVER_MY_AFIOZ ()
  145 {
  146     case $1 in
  147         -test)
  148             # This function should check whether all prerequisites are met, especially if all
  149             # required tools are installed. This prevents backup2l to fail in inconvenient
  150             # situations, e. g. during a backup or restore operation. If everything is ok, the
  151             # string "ok" should be returned. Everything else is interpreted as a failure.
  152             require_tools afio
  153                 # The function 'require_tools' checks for the existence of all tools passed as
  154                 # arguments. If one of the tools is not found by which(1), an error message is
  155                 # displayed and the function does not return.
  156             echo "ok"
  157             ;;
  158         -suffix)
  159             # This function should return the suffix of backup archive files. If the driver
  160             #ädoes not create a file (e. g. transfers the backup data immediately to a tape
  161             # or network device), an empty string has to be returned. backup2l uses this suffix
  162             # to select a driver for unpacking. If a user-configured driver supports the same
  163             # suffix as a built-in driver, the user driver is preferred (as in this case).
  164             echo "afioz"
  165             ;;
  166         -create)        # Arguments: $2 = BID, $3 = archive file name, $4 = file list file
  167             # This function is called to create a backup file. The argument $3 is the full file
  168             # name of the archive file including path and suffix. $4 contains an alphabetically
  169             # sorted  list of files (full pathname) to be backed up. Directories are not contained,
  170             # they are handled by backup2l directly without using the driver.
  171             # All output to stderr should be directed to stdout ("2>&1").
  172             afio -Zo -G 9 -M 30m -T 2k $3 < $4 2>&1
  173                 # This line passes some additional options to afio (see afio(1)):
  174                 # '-G 9' maximizes the compression by gzip.
  175                 # '-M 30m' increases the size of the internal file buffer. Larger files have to
  176                 #     be compressed twice.
  177                 # '-T 2k' prevents the compression of files smaller than 2k in order to save time.
  178             ;;
  179         -toc)           # Arguments: $2 = BID, $3 = archive file name
  180             # This function is used to validate the correct generation of an archive file.
  181             # The output is compared to the list file passed to the '-create' function.
  182             # Any difference is reported as an error.
  183             afio -Zt $3 | sed 's#^#/#'
  184                 # The sed command adds a leading slash to each entry.
  185             ;;
  186         -extract)       # Arguments: $2 = BID, $3 = archive file name, $4 = file list file
  187             # This function is called by backup2l's restore procedure for each archive.
  188             # It is extremely important that only those files contained in $4 are restored.
  189             # Otherwise it may happen that files are overwritten by incorrect (e. g. older)
  190             # versions of the same file.
  191             afio -Zinw $4 $3 2>&1
  192             ;;
  193     esac
  194 }
  195 
  196 
  197 
  198 ##################################################
  199 # More sample archive drivers (optional)
  200 
  201 # This is an unordered collection of drivers that may be useful for you,
  202 # either to use them directly or to derive own drivers.
  203 
  204 
  205 # Here's a version of the standard DRIVER_TAR_GZ driver,
  206 # modified to split the output archive file into multiple sections.
  207 # (donated by Michael Moedt)
  208 DRIVER_TAR_GZ_SPLIT ()
  209 {
  210     case $1 in
  211         -test)
  212             require_tools tar split cat
  213             echo "ok"
  214             ;;
  215         -suffix)
  216             echo "tgz_split"
  217             ;;
  218         -create)        # Arguments: $2 = BID, $3 = archive file name, $4 = file list file
  219             mkdir -p ${3}
  220             tar cz -T $4 --no-recursion | split --bytes=725100100 - ${3}/part_
  221             ;;
  222         -toc)           # Arguments: $2 = BID, $3 = archive file name
  223             cat ${3}/part_* | tar tz | sed 's#^#/#'
  224             ;;
  225         -extract)       # Arguments: $2 = BID, $3 = archive file name, $4 = file list file
  226             cat ${3}/part_* | tar xz --same-permission --same-owner -T $4 2>&1
  227             ;;
  228     esac
  229 }
  230 
  231 
  232 # This driver uses afio and bzip2, where bzip2 is invoked by afio.
  233 # (donated by Carl Staelin)
  234 DRIVER_MY_AFIOBZ2 ()
  235 {
  236     case $1 in
  237         -test)
  238             require_tools afio bzip2
  239             echo "ok"
  240             ;;
  241         -suffix)
  242             echo "afio-bz2"
  243             ;;
  244         -create)        # Arguments: $2 = BID, $3 = archive file name, $4 = file list file
  245             afio -z -1 m -P bzip2 -Q -9 -Z -M 50m -T 1k -o $3 <$4 2>&1
  246                 # This line passes some additional options to afio (see afio(1)):
  247                 # '-P bzip2' utilizes bzip2 as an external compressor
  248                 # '-Q 9' maximizes the compression by bzip2.
  249                 # '-M 50m' increases the size of the internal file buffer. Larger files have to
  250                 #     be compressed twice.
  251                 # '-T 1k' prevents the compression of files smaller than 1k in order to save time.
  252             ;;
  253         -toc)           # Arguments: $2 = BID, $3 = archive file name
  254             afio -t -Z -P bzip2 -Q -d - <$3 | sed 's#^#/#'
  255                 # The sed command adds a leading slash to each entry.
  256             ;;
  257         -extract)       # Arguments: $2 = BID, $3 = archive file name, $4 = file list file
  258             afio -Zinw $4 -P bzip2 -Q -d - <$3 2>&1
  259             ;;
  260     esac
  261 }
  262 
  263 
  264 # This driver uses afio and bzip2, such that the I/O stream is piped through bzip2.
  265 # (donated by Carl Staelin)
  266 DRIVER_MY_AFIO_BZ2 ()
  267 {
  268     case $1 in
  269         -test)
  270             require_tools afio bzip2
  271             echo "ok"
  272             ;;
  273         -suffix)
  274             echo "afio.bz2"
  275             ;;
  276         -create)        # Arguments: $2 = BID, $3 = archive file name, $4 = file list file
  277             afio -o - < $4 | bzip2 --best > $3 2>&1
  278             ;;
  279         -toc)           # Arguments: $2 = BID, $3 = archive file name
  280             bzip2 -d < $3 | afio -t - | sed 's#^#/#'
  281                 # The sed command adds a leading slash to each entry.
  282             ;;
  283         -extract)       # Arguments: $2 = BID, $3 = archive file name, $4 = file list file
  284             bzip2 -d < $3 | afio -inw $4 - 2>&1
  285             ;;
  286     esac
  287 }
  288 
  289 
  290 
  291 # This driver uses the Info-ZIP tools to generate zip files. Unfourtunately unzip
  292 # expects all file names to be on the command line. So unless there is a work-
  293 # around it's not possible to use the "-extract" command.
  294 # (donated by Georg Lutz)
  295 DRIVER_ZIP ()
  296 {
  297     case $1 in
  298         -test)
  299         require_tools zip
  300         echo "ok"
  301            ;;
  302         -suffix)
  303             echo "zip"
  304             ;;
  305         -create)        # Arguments: $2 = BID, $3 = archive file name, $4 = file list file
  306         cat $4| zip -qy $3 -@
  307             ;;
  308         -toc)           # Arguments: $2 = BID, $3 = archive file name
  309             zipinfo -1 $3| sed 's#^#/#'
  310             ;;
  311         -extract)       # Arguments: $2 = BID, $3 = archive file name, $4 = file list file
  312            echo "Not implemented yet! Sorry."
  313        #unzip $3
  314             ;;
  315     esac
  316 }
  317 
  318 
  319 # This driver uses tar and pipes the output trough gnupg. You can specifiy
  320 # the passphrase in a file (/etc/backup2l.pass in the example). You have to
  321 # invoke gpg at least one time before backup because gnupg has to initiate
  322 # first thing in the home directory.
  323 DRIVER_TAR_GPG ()
  324 {
  325     case $1 in
  326     -test)
  327         require_tools tar gpg
  328         echo "ok"
  329         ;;
  330         -suffix)
  331             echo "tar.pgp"
  332             ;;
  333         -create)        # Arguments: $2 = BID, $3 = archive file name, $4 = file list file
  334             tar -c -T $4 --no-recursion | /usr/bin/gpg --batch --no-tty -q --passphrase-fd 3 3</etc/backup2l.pass -c -  > $3
  335             ;;
  336         -toc)           # Arguments: $2 = BID, $3 = archive file name
  337             /usr/bin/gpg --batch --no-tty -q --passphrase-fd 3 3</etc/backup2l.pass -d $3 2>/dev/null | tar t | sed 's#^#/#'
  338             ;;
  339         -extract)       # Arguments: $2 = BID, $3 = archive file name, $4 = file list file
  340              /usr/bin/gpg --batch --no-tty -q --passphrase-fd 3 3</etc/backup2l.pass -d $3 2>/dev/null | tar -x --same-permission --same-owner -f $3 -T $4 2>&1
  341             ;;
  342     esac
  343 }