#!/bin/ksh -p # For more detailed documentation, see zrep.txt or zrep.overview.txt ZREP_VERSION=1.0.1 ######## start of included files from zrep_top here AWKinclude zrep_vars AWKinclude zrep_status AWKinclude zrep_snap AWKinclude zrep_sync AWKinclude zrep_failover ######## zrep_top continues here usage(){ print zrep v${ZREP_VERSION}: a program to replicate a zfs filesystem to another print in an ongoing basis. print More documentation at a later date. print " Philip Brown, 2012" print "" print Simple usage summary: print 'zrep (init|-i) ZFS/fs remotehost remoteZFSpool/fs' print 'zrep (sync|-S) [-q seconds] ZFS/fs' print 'zrep (sync|-S) [-q seconds] all' print 'zrep (sync|-S) ZFS/fs@snapshot -- temporary retroactive sync' print 'zrep (status|-s) [-v] [(-a|ZFS/fs)]' print 'zrep refresh ZFS/fs -- pull version of sync' print 'zrep (list|-l) [-v]' print 'zrep (expire|-e) [-L] (ZFS/fs ...)|(all)|()' print 'zrep (changeconfig|-C) ZFS/fs remotehost remoteZFSpool/fs' print 'zrep failover [-L] ZFS/fs' print 'zrep takeover [-L] ZFS/fs' print 'zrep clear ZFS/fs -- REMOVE ZREP CONFIG AND SNAPS FROM FILESYSTEM' print print ' -q option says to Quietly ignore locked filesystems that have synced' print ' more recently than the given amount of seconds' print print 'Paired commands for high-transaction systems:' print ' zrep snaponly ZFS/fs' print ' zrep synconly ZFS/fs' print 'The above two commands split the simple sync subcommand, into two' print 'separate steps, so that a database, etc. may resume while the sync' print 'completes in the background' print '' print ' More detailed examples can be found at:' print http://www.bolthole.com/solaris/zrep/zrep.documentation.html } case "$1" in "") usage ;; clear) shift zrep_clear $1 ;; expire|-e) shift zrep_expire "$@" ;; init|-i) shift zrep_init "$@" ;; changeconfig|-C) shift zrep_changeconfig "$@" ;; sync|-S) shift zrep_sync "$@" ;; snaponly) shift zrep_snaponly "$@" ;; synconly) shift zrep_synconly "$@" ;; refresh) # yes keep this in this order shift zrep_refresh "$@" ;; status|-s) shift zrep_status "$@" ;; list|-l) shift zrep_list "$@" ;; failover) shift zrep_failover "$@" ;; takeover) shift zrep_takeover "$@" ;; _refreshpull) # Secret option DO NOT PUT IN USAGE!! shift _refreshpull $1 ;; *) usage ;; esac