Gads, and I thought that Bacula was complicated. :-)
Cool just the same!
On Wednesday 14 September 2005 19:22, Matthias Kurz wrote:
> On Wed, Sep 14, 2005, Matthias Kurz wrote:
>
> [...]
>
> > A general script could just be called as "uv <pool-name>".
>
> I could not resist:
>
> ---------8<---------8<---------8<---------8<---------8<---------8<---------
>8< #!/bin/env expect -f
>
> proc Choose {mentry} {
> global iprompt
> set mentry_re " *(\[0-9]+): $mentry\r\n"
> expect {
> -nocase \
> -re $mentry_re { set index $expect_out(1,string); exp_continue }
> -re $iprompt { send "$index\r" }
> }
> }
>
> proc ChooseMediaID {} {
> expect -re "\\| +(\[0-9]+) "
> set mediaID $expect_out(1,string)
> expect -re "\r\n\[^|+-]+ name: "
> send "$mediaID\r"
> }
>
> #
> # ----------------------------------- MAIN
> ------------------------------------ #
>
> # log_file -noappend uv.log
>
> set poolName [lindex $argv 0]
> set prompt "\r\n\\*"
> set iprompt " \\(1-\[0-9]+\\): "
>
> spawn bconsole
>
> expect -re $prompt
> send "update volumes\r"
>
> Choose "volume parameters"
> Choose $poolName
> ChooseMediaID
> Choose "all volumes from pool"
> Choose $poolName
>
> expect -re $prompt
> send "exit\r"
>
> expect { "*" { exp_continue }
> eof { exit } }
>
> --------->8--------->8--------->8--------->8--------->8--------->8---------
>>8
>
>
> (mk)
--
Best regards,
Kern
(">
/\
V_V
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users