Source

aws_zfs_tools / zfs-config.sh.example

Full commit
#! /bin/bash

# zfs-config.sh
#
# Chip Schweiss - chip.schweiss@wustl.edu
#
# Copyright (C) 2012  Chip Schweiss

# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.


# The directory we are storing all of our snapshot and ec2tools

TOOLS_ROOT="/mypool/tools"

# Some jobs will use temp space.  In the case of restore for Glacier this may need to be large.
TMP=/mypool/temp

# Set the debug level

# 0 - Debug
# 1 - Notice
# 2 - Warning
# 3 - Error

debug_level="0"

# Set the logging level
# 0 - Debug
# 1 - Notice
# 2 - Warning
# 3 - Error

logging_level="1"

default_logfile="/var/log/aws-zfs-tools.log"

default_report_name="aws-zfs-tools"

###
#
# ZFS backups
#
###

zfs_logfile="/var/log/zfs-tools-zfsbackup.log"

zfs_report="ZFSbackup"


###
#
# AWS backups
#
###


# GPG key ring

gpg_user="zfs-tools"

# Snapshot prefix for tools generated snapshots.

tools_snapshot_name="aws-backup_"

# Amazon EC2 instance id we are backing up to.  If the scripts are running locally on your instance
# keep them as they are, otherwise change to the instance-id.

    # Enable EC2 backup
    ec2_backup="false"

    instanceid=$(ec2metadata --instance-id)
    
    # Amazon zone.  Again if running on the instance the example is fine.
    
    zone=$(ec2metadata --availability-zone)
    
    # Instance Hostname.  If you are running these scripts externally this needs to be
    # hard coded to the EC2 instance hostname.   It is used in tagging EBS volumes.
    
    instance_hostname="${HOSTNAME}"
    
    # Public DNS name of instance.  This is used if these scripts are run externally.
    
    instance_dns="aws-zfs01.homenet.org"
    
    # Remote call prefix.  If you want these script to run off the EC2 instance use the format
    # that is commented out and setup ssh public key authentication.
    
    remote=""
    #remote="ssh root@${instance_dns}"
    
    # Name of the ZFS pool we are creating or manipulating
    
    ec2_zfspool="mypool"
    
    # The type of redunancy being used in each vdev
    # Can be mirror, raidz1, raidz2, or raidz3
    
    raidz="raidz1"
    
    # Number of raidz vdevs in the pool
    
    vdevs=5
    
    # Number of EBS block devices per raidz vdev
    
    devices=8
    
    # Size of each EBS block device in Gigabytes.   Must be a whole number 1 or greater.
    # You can increase this later and run grow-zfs-pool.sh
    
    devsize=2
    
    # First device letter used in the pool.   EC2 defaults to 'f' as in /dev/sdf
    
    dev_first_letter="f"
    
    # Use crypto layer?  If set to 'true' it will, anything else will ignore.
    
    crypt="false"
    
    # Staging zfs folder for sync to EC2
    
    staging_folder="/stagingpool/primarystaging"
    
    # rpool backup folder
    
    rpool_backup_folder="/stagingpool/primarystaging/rpool_backup"
    
    # Accelerate the tranfers to EC2 via bbcp
    # Set this to the path to the binary for bbcp
    # The bbcp binary must be in the search path on the EC2 instance.
    # see http://www.slac.stanford.edu/~abh/bbcp/
    
    bbcp="/usr/bin/bbcp"
    bbcp_streams="10"    # Definately tune this for your connection
    
    # Use EC2 instance storage to dump the zfs send to first to verify the send is succesful before
    # using ZFS receive
    
    inst_store_staging="true"

# Alternate backup to Glacier

    # Which glacier tool to use for backup
    # Currently support glacier-cmd and mt-aws-glacier
    
    glacier_tool="mt-aws-glacier"

    # Sequence number we start on.  1000 is chosen to simplify sorting and script math.  This way
    # all sequences will have a 4 digit number.

    glacier_start_sequence="1000"

    # Default days to rotate glacier vaults.  Can over ride in setup-filesystems.sh

    glacier_rotation_days="180"

    # Default rotation number.  

    glacier_start_rotation="100"

    # Seconds between launching backup jobs

    glacier_job_stagger="600"

# Make sure the EC2 Private Key and Cert files are referenced

EC2_PRIVATE_KEY=/root/pk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.pem
EC2_CERT=/root/cert-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.pem

# EC2 API tools must be in the path and its location defined in the EC2_HOME environment variable
# Some instances from Amazon already have these installed and in the path.
# It is recommended that once you have your jobs fully running from a terminal, to put the PATH you 
# have in the terminal here before creating cron jobs.

PATH=$PATH:/root/tools/ec2-api-tools-1.5.5.0/bin
EC2_HOME=/root/tools/ec2-api-tools-1.5.5.0

# JAVA_HOME must also be defined for the EC2 API Tools to work
JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64

##
#
# Email reporting: Requires mutt to be installed and configured
#
##

    # Address to send reports to
    email_to="cts-admin@nrg.wustl.edu"

    # Address(s) to cc reports to (use a space to separate)
    email_cc=""

    # Address(s) to bcc reports to (use a space to separate)
    email_bcc=""

    # When to send debug level messages (now,report,never)
    email_debug="report"

    # When to send notice level messages (now,report,never)
    email_notice="report"

    # When to send warnings level messages (now,report,never)
    email_warnings="now"

    # When to send error level messages (now,report,never)
    email_errors="now"

    # Path to mutt binary
    mutt="/opt/csw/bin/mutt"
    
# Snapshot type to be handled

snaptypes="hourly daily mid-day weekly monthly bi-annual annual"