diff --git a/backup-zfs b/backup-zfs index 92fd708..a6d200c 100755 --- a/backup-zfs +++ b/backup-zfs @@ -2,14 +2,14 @@ # backup-zfs: use zfs send/recv to push/pull snapshots usage() { - echo "$(basename "$0") [-hvq] [-t tag] [-k keep] [-f dateformat] [srchost:]srcfs [desthost:]destfs" >&2 + echo "$(basename "$0") [-hvq] [-t tag] [-k keep] [-d dateopts] [srchost:]srcfs [desthost:]destfs" >&2 echo "$(basename "$0"): use zfs send/recv to push/pull snapshots" >&2 printf "%15s: %s\n" >&2 "-h" "this help statement" \ "-v" "verbose" \ "-q" "quiet" \ "-t tag" "tag to use for naming snapshots and in syslog" \ "-k keep" "number of snapshots to keep on src" \ - "-f dateformat" "format string for date(1), used in naming snapshots" + "-d dateopts" "options string for date(1), used in naming snapshots" exit $1 } @@ -53,7 +53,7 @@ ZFS() { ### defaults ### tag=backup-zfs -dateformat="%F_%T" +dateopts="+%F_%T" keep=5 verbose=false quiet=false @@ -61,19 +61,19 @@ quiet=false ### ### parse options ### -while getopts "hvqk:t:f:" opt ; do +while getopts "hvqk:t:d:" opt ; do case $opt in h) usage 0 ;; v) verbose=true ;; q) quiet=true ;; k) keep=$OPTARG ;; t) tag=$OPTARG ;; - f) dateformat=$OPTARG ;; + d) dateopts=$OPTARG ;; *) usage 1 ;; esac done shift $((OPTIND-1)) -date="$(date +"$dateformat")" +date="$(date $dateopts)" ### ### parse src & dest host/fs info