#------------------------------------------------------------------------------# # vi: set sw=4 ts=4 ai: ("set modeline" in ~/.exrc) # #------------------------------------------------------------------------------# # Config file : makebackup.conf # # # # Author : Ton Kersten Groesbeek, The Netherlands # # # # Description : Configuration file for 'makebackup' # #------------------------------------------------------------------------------# #------------------------------------------------------------------------------# # V e r s i o n i n f o r m a t i o n # #------------------------------------------------------------------------------# # $Id:: makebackup.conf 15 2013-08-07 11:09:19 tonk $: # # $Revision:: 15 $: # # $Author:: Ton Kersten $: # # $Date:: 2013-08-07 11:09:29 +0200 (Wed, 07 Aug 2013) $: # #------------------------------------------------------------------------------# # E n d o f v e r s i o n i n f o r m a t i o n # #------------------------------------------------------------------------------# #------------------------------------------------------------------------------# # Maximum number of cycles to keep (This is the default for all destinations) # # It's also possible to define a number of cycles per backup set (CYCL[$BCKS]) # #------------------------------------------------------------------------------# MAX="14" #------------------------------------------------------------------------------# # Create MySQL backups? (You need the 'mysqlbackup' program for this to work) # # You need the 'mysqlbackup' program for this to work and you can get this at # # http://tonkersten.com # #------------------------------------------------------------------------------# BACKUPMYSQL="yes" #------------------------------------------------------------------------------# # Set debugging options (DEBUG=1 switches on 'set -x' in the script) # #------------------------------------------------------------------------------# VERBOSE=1 DEBUG=0 #------------------------------------------------------------------------------# # Set syslog and facility (Optional. If SYSLOG=0, no extra syslog output) # #------------------------------------------------------------------------------# SYSLOG=1 SYSLOGFAC="local4.info" #------------------------------------------------------------------------------# # Create monthly backups? # #------------------------------------------------------------------------------# MONTHLY="yes" MONTHLYMAX="36" #------------------------------------------------------------------------------# # Add extra options to the rsync command. # # Normally '-aRqx --delete -e ssh' is used. # #------------------------------------------------------------------------------# RSYNCOPTS="HA" #------------------------------------------------------------------------------# # Define who gets the mail with the logging # # # # This can be: # # - A standard email address # # - syslog -> All logging goes to syslog # # - stdout -> All logging goes to stdout # #------------------------------------------------------------------------------# MAILTO="root@localhost" #------------------------------------------------------------------------------# # Define a pre and post backup command (e.g. Mount or umount a disk) # #------------------------------------------------------------------------------# PREBACKUP="" POSTBACKUP="" #------------------------------------------------------------------------------# # Define what to backup and where to put it. # # Standard Bash syntax is needed here and the variables used are: # # # # BCKS -> The number of backup sets (increase by one per set) # # DESC[i] -> The description for this backup set # # SHRT[i] -> Short description for this backup set (Used with syslog) # # CYCL[i] -> The number of backup cycles to keep (optional, default $MAX) # # DSTS[i] -> The destination for this backup set. Multiple dests are allowed # # DIRS[i] -> Directories to backup. Multiple dirs are allowed # # EXCL[i] -> "Things" to exclude. See also: man rsync # # REMOVE[i] -> When set to "REMOVE_OBSOLETE_BACKUP" DSTS[i] will be removed # # # # The index 'i' is the 'set index' and is the value of 'BCKS' # # Example: DESC[${BCKS}]="Filesystem backup for server data" # # # #------------------------------------------------------------------------------# # # # For remote server backup SSH key access is needed for user user root. # # Place the option # # PermitRootLogin forced-commands-only # # in the file 'sshd_config' # # # # And put the ssh-key in '/root/.ssh/authorized_keys' starting with: # # from="BackupServerIP",command="/usr/local/bin/check_command" # # (replace 'BackupServerIP' with the IP address of the backup server.) # # # # The command 'check_command' checks if the requested command is a 'rsync' # # command and acts accordingly. # # This is a very simple script, containing" # # # # #!/bin/bash # # case "${SSH_ORIGINAL_COMMAND}" # # in # # *\&*) # # echo "Rejected" # # ;; # # *\(*) # # echo "Rejected" # # ;; # # *\{*) # # echo "Rejected" # # ;; # # *\;*) # # echo "Rejected" # # ;; # # *\<*) # # echo "Rejected" # # ;; # # *\`*) # # echo "Rejected" # # ;; # # *\|*) # # echo "Rejected" # # ;; # # rsync\ --server*) # # ${SSH_ORIGINAL_COMMAND} # # ;; # # *) # # echo "Rejected" # # ;; # # esac # # # #------------------------------------------------------------------------------# #------------------------------------------------------------------------------# # Define the prutser directories # #------------------------------------------------------------------------------# BCKS=${BCKS}+1 DESC[${BCKS}]="Filesystem backup for server prutser" SHRT[${BCKS}]="prutser" DSTS[${BCKS}]="" DSTS[${BCKS}]="${DSTS[${BCKS}]} /backup/backups/prutser" DIRS[${BCKS}]="" DIRS[${BCKS}]="${DIRS[${BCKS}]} 192.168.63.4:/root" DIRS[${BCKS}]="${DIRS[${BCKS}]} 192.168.63.4:/etc" DIRS[${BCKS}]="${DIRS[${BCKS}]} 192.168.63.4:/var/named" EXCL[${BCKS}]="" EXCL[${BCKS}]="${EXCL[${BCKS}]} *~" EXCL[${BCKS}]="${EXCL[${BCKS}]} *.bak" #------------------------------------------------------------------------------# # Define the localhost directories # #------------------------------------------------------------------------------# BCKS=${BCKS}+1 DESC[${BCKS}]="Filesystem backup for server vmware" SHRT[${BCKS}]="vmware" DSTS[${BCKS}]="" DSTS[${BCKS}]="${DSTS[${BCKS}]} /backup/backups/vmware" DIRS[${BCKS}]="" DIRS[${BCKS}]="${DIRS[${BCKS}]} /root" DIRS[${BCKS}]="${DIRS[${BCKS}]} /etc" DIRS[${BCKS}]="${DIRS[${BCKS}]} /home" DIRS[${BCKS}]="${DIRS[${BCKS}]} /data/share" #------------------------------------------------------------------------------# # And to the external disk # #------------------------------------------------------------------------------# BCKS=${BCKS}+1 CYCL[${BCKS}]="31" # Keep more cycles for this backup # DESC[${BCKS}]="Filesystem backup for server vmware to kliko" SHRT[${BCKS}]="vmware to kliko" DSTS[${BCKS}]="" DSTS[${BCKS}]="${DSTS[${BCKS}]} /media/kliko/backups/vmware" DIRS[${BCKS}]="" DIRS[${BCKS}]="${DIRS[${BCKS}]} /root" DIRS[${BCKS}]="${DIRS[${BCKS}]} /etc" DIRS[${BCKS}]="${DIRS[${BCKS}]} /home" DIRS[${BCKS}]="${DIRS[${BCKS}]} /data/share" #------------------------------------------------------------------------------# # Another way to do it: # # Include all configs in the 'conf' directory # #------------------------------------------------------------------------------# ## for conf in ${CRD}/conf/*.conf ## do ## echo " Including config file ${conf}" ## . ${conf} ## done