# Default configuration structure for sneakernet # This file is loaded by the sneakernet script to provide default configuration values # Variables from $programDefinition hashref (scriptDirectory, scriptFullPath) will be interpolated at runtime { 'dryrun' => 0, # if set to 1, will not perform any changes, just log what would be done 'verbosity' => 1, # verbosity level for logging 'debug' => 0, # set to number greater than 0 for debugging program 'statusFile' => "/sneakernet_target.status", # file created on source server to track last copied dataset 'logFile' => ".log", 'displayLogsOnTTY' => '', # if set to path of a tty, log messages will be sent there also. Example: /dev/ttyv1 'displayLogsOnConsole' => 1, # If set to non-zero, will send log messages to screen in addition to log file 'source' => { # information about source server 'hostname' => '', # used to see if we are on source 'poolname' => 'pool', # name of the ZFS default parent pool to export 'historyFile' => '/history.tsv', # Tab-delimited file recording previous replication stream size estimates for each dataset/command. Used for historical validation. 'runningAverageCount' => 6, # Number of previous entries from the history file to use when calculating the running average for size estimate validation. 'cleanUpScriptsDir' => '/cleanupScripts', # Location on disk where scripts to be sent to target are located. 'oneShotCleanup' => '', # Directory containing cleanup scripts that are copied to the transport drive only once and then deleted from the source after transfer. 'cleanupScriptSchedule' => { # Hash mapping script names to arrays of months (1-12) when each script should run. Scripts not listed here are not run by default 'zpoolStats' => [1..12], # Pool statistics every month 'transportStats' => [1..12], # Transport disk statistics every month 'runSmart' => [1, 7], # Run SMART tests semi-annually (Jan, Jul) 'scrubZFS' => [2, 5, 8, 11], # Scrub ZFS pools quarterly 'trimZFS' => [3, 6, 9, 12], # TRIM SSDs quarterly 'cleanSnaps' => [1..12], # Clean old snapshots monthly }, 'report' => { # if set, will generate a report via email or by storing on a drive 'email' => '', # if set, will email the report to this address 'subject' => '', # subject of the report email (will be auto-generated if empty) 'targetDrive' => { # if set, will store the report on this drive 'label' => '', # the GPT or msdos label of the report drive, REQUIRED 'fstype' => '', # filesystem type of the report drive, default is msdos 'checkInterval' => 15, # how often to check for the disk (seconds), message displayed every interval 'waitTimeout' => 300, # time to wait for the disk to appear in seconds 'mountPoint' => '', # where to mount the report drive, default is /mnt/label } } }, 'target' => { # information about target server 'hostname' => '', # used to see if we are on target 'poolname' => '', # name of the ZFS pool to import 'stateFileName' => 'target_state.txt', # name of file to store all snapshots on the report drive, if defined 'stateFile' => "/states/targetState", # A list of snapshots will be placed here before any changes 'cleanUpScriptsDir' => 'cleanUpScripts', # relative path on transport drive containing encrypted Perl scripts to run after target update (e.g., 'cleanup_scripts') 'maintenanceMode' => { # defines how to get the script to exit without processing 'timeout' => 300, # How much time to wait for flag to appear, in seconds. Default to 5 minutes 'checkPeriod' => 15, # how many seconds to wait between checks 'flags' => { # multiple flags allowed. key is "where to look" and value is "what file to look for' 'transport' => 'maintenance', # look on transport drive for file /maintenance (path relative to mount point) 'local' => '/tmp/maintenance', # look on local file system for file /tmp/maintenance } }, 'shutdownAfterReplication' => 0, # if set to 1, will shutdown the server after replication 'geli' => { # if this is set, the dataset uses GELI. Not required if zpool is already imported 'secureKey' => { # where to load part of the GELI key from 'label' => '', # the GPT label of the key disk 'fstype' => '', # filesystem type of the key disk (msdos or ufs) 'checkInterval' => 15, # how often to check for the disk (seconds), message displayed every interval 'waitTimeout' => 300, # time to wait for the disk to appear in seconds 'keyfile' => 'geli.key', # the name of the key file on the secureKey disk }, 'localKey' => '', # hex representation of the local key part 'target' => '', # location to create the combined keyfile 'poolname' => '', # name of the ZFS pool to import, probably same as target.poolname # disk list is generally an empty array. While various formats are available for indicating this in YAML # I have run into problems using anything other than 'diskList': [] (or leave it out completely) 'diskList' => [] # list of disks to try to mount the dataset from. default is to check for all unmounted and unpartitioned disks }, 'report' => { # if enabled, will send a report after replication 'email' => '', # if set, will email the report to this address 'subject' => '', # subject of the report email (will be auto-generated if empty) 'targetDrive' => { # if set, will store the report on this drive 'fstype' => 'msdos', # filesystem type of the report drive 'label' => '', # the GPT or msdos label of the report drive 'mountPoint' => '', # where to mount the report drive, default is /mnt/label } } }, 'transport' => { # configuration for the transport disk 'label' => 'sneakernet', # this is the GPT label of the sneakernet disk, REQUIRED 'fstype' => 'ufs', # this is the file system type. default is ufs 'mountPoint' => '/mnt/sneakernet', # where we want to mount it, default is /mnt/label 'datasetDir' => 'datasets', # subdirectory on transport disk for storing dataset files 'serialFile' => 'serial.txt', # name of the serial file on transport disk to track processing status 'timeout' => 600, # amount of time to wait for the disk to appear, in seconds. Default 600 seconds (10 minutes) 'checkInterval' => 15, # How often to check for the disk (seconds), message displayed every interval, default 15 seconds 'encryptionKey' => '', # If set, all files written to the transport drive will be encrypted using this key (32 hex bytes). Generate with: openssl rand 32 | xxd -p | tr -d '\n' }, 'datasets' => { # datasets to replicate 'dataset1' => { 'source' => 'pool', # the parent of the dataset on the source 'target' => 'backup', # the parent of the dataset on the target 'dataset' => 'dataset1', # the dataset name 'maxDelta' => 0.25, # The maximum factor by which a new size estimate can exceed the running average of previous estimates for this dataset. For example, 2.0 means the estimate can be up to 2x the average. }, #'files_share' => { # 'source' => 'pool', # 'target' => 'backup', # 'dataset' => 'files_share', #}, }, }