On Sat, May 12, 2007 at 03:28:40PM -0600, Philip Guenther wrote:
> >
> >+ dump=dump

On Solaris this would be ufsdump, and other folk may have different
requirements here too:

> >+ dump_flags=anu -f - -h 0
> >+ encryption=openssl enc -bf -salt
> 
> Argh, that what I get for not stating my assumptions clearly.  I
> assumed dump_flags would just be a single argument of options and not
> something in need to word splitting.  Ditto for encryption.  Since you
> actually _want_ those to be split into multiple arguments, they can't
> be double-quoted when eval sees them.  (And my alternative version
> using "IFS=" won't work at all, as that disables word splitting
> completely.)
> 
>       cmd='"${dump}" -${level}${dump_flags} "${device}" | gzip -9'
>       if [[ ! -z ${encryption} ]]; then
>               cmd="${cmd}"' | ${encryption} -pass "file:${conf}.passwd"
>               -out'
>       else
>               cmd="${cmd} -o"
>       fi
>       eval "${cmd}"' "${file}"'

Right then, now:

dmp_cmd='"${dump}" -${level}${dump_flags} "${device}" | gzip -9'
[[ ! -z ${encryption} ]] && dmp_cmd="${dmp_cmd}"' | ${encryption} -pass 
"file:${conf}.passwd"'
[ ${debug} ] && echo "${dmp_cmd} > ${file}\n"
eval "${dmp_cmd}"' > "${file}"'
[ ${digest} ] && ${digest} ${file} > ${checksum}
[ ${debug} ] && du -h ${file}*



# /usr/local/site/sbin/dumpster_slices teak 5 Tuesday

dumping /var/mail

dumpster_slices dumping /dev/wd0g to 
/tmp/tmp.cPzkt15527/teak/_var_mail_5_Tuesday.dump.gz.crypto:


Broadcast Message from [EMAIL PROTECTED]
        (/dev/ttyp1) at 22:43 ...

unmounting /var/mail for dumping in 5 minutes! Save your work.

postfix/postfix-script: stopping the Postfix mail system

Broadcast Message from [EMAIL PROTECTED]
        (/dev/ttyp1) at 22:43 ...

unmounting /var/mail for dumping in 1 minute! Save your work.


Broadcast Message from [EMAIL PROTECTED]
        (/dev/ttyp1) at 22:43 ...

unmounting /var/mail for dumping NOW!

"${dump}" -${level}${dump_flags} "${device}" | gzip -9 | ${encryption} -pass 
"file:${conf}.passwd" > 
/tmp/tmp.cPzkt15527/teak/_var_mail_5_Tuesday.dump.gz.crypto

  DUMP: Date of this level 5 dump: Sat May 12 22:43:45 2007
  DUMP: Date of last level 4 dump: Wed May  9 23:54:....
  DUMP: level 5 dump on Sat May 12 22:43:45 2007

Broadcast Message from [EMAIL PROTECTED]
        (/dev/ttyp1) at 22:43 ...

Message from the dump program to all operators

DUMP: NEEDS ATTENTION: level 5 dump on Sat May 12 22:43:45 2007
DUMP IS DONE!

  DUMP: DUMP IS DONE
496K    /tmp/tmp.cPzkt15527/teak/_var_mail_5_Tuesday.dump.gz.crypto
2.0K /tmp/tmp.cPzkt15527/teak/_var_mail_5_Tuesday.dump.gz.crypto.digest

Broadcast Message from [EMAIL PROTECTED]
        (/dev/ttyp1) at 22:43 ...

mounted /var/mail after dumping

/usr/local/site/sbin/postfixctl start
postfix/postfix-script: starting the Postfix mail system

dumpster_offsite uploading
/tmp/tmp.cPzkt15527/teak/_var_mail_5_Tuesday.dump.gz.crypto to ftp.lu...


# du /var/dumped/teak/_var_mail_5*
496K    /var/dumped/teak/_var_mail_5_Tuesday.dump.gz.crypto
2.0K    /var/dumped/teak/_var_mail_5_Tuesday.dump.gz.crypto.digest


So that is working, ta muchly!

I'll have to audit the other scripts in the suite:
dumpster
dumpster_backup
dumpster_offsite

It is shaping up quite well, here is a partial list at my ISP, showing
various periods & towers of hanoi:

$ cd ~/dumpster/cedar
$ ls -1 _home*
_home_0.dump.gz
_home_1_Quater-1.dump.gz
_home_2_April.dump.gz
_home_2_February.dump.gz
_home_2_January.dump.gz
_home_2_March.dump.gz
_home_2_May.dump.gz
_home_3_Week-00.dump.gz
_home_3_Week-01.dump.gz
_home_3_Week-02.dump.gz
_home_3_Week-03.dump.gz
_home_3_Week-04.dump.gz
_home_3_Week-05.dump.gz
_home_3_Week-06.dump.gz
_home_3_Week-07.dump.gz
_home_3_Week-09.dump.gz
_home_3_Week-10.dump.gz
_home_3_Week-11.dump.gz
_home_3_Week-12.dump.gz
_home_4_Wednesday.dump.gz
_home_4_Wednesday.dump.gz.checksum
_home_5_Tuesday.dump.gz
_home_6_Friday.dump.gz
_home_6_Friday.dump.gz.digest
_home_7_Thursday.dump.gz
_home_7_Thursday.dump.gz.digest
_home_8_Sunday.dump.gz
_home_9_Saturday.dump.gz
_home_9_Saturday.dump.gz.crypto
_home_9_Saturday.dump.gz.crypto.digest


Next TODO is to get it running as operator, like amanda. Plenty of
sudo ahead, me thinks...

OpenBSD is the best for this! Everything one could need is in base,
and... it all works! Kudos to the team.

> 
> 
> Philip Guenther

-- 
Craig Skinner | http://www.kepax.co.uk | [EMAIL PROTECTED]

Reply via email to