Hi Bill and Josh,

I just want to say again how helpful your support and development skills
have been, not just for our system here but also helping a relative novice
like me get my head around scripting approaches!

I will be implementing a lot of this for our system over the coming days
(another Chinese holiday) and I want to make sure I have a few things
right. Bill, your latest script serves to check which magazine is currently
inserted and then runs benablemag with the appropriate variable for that
magazine, correct?

Our use case here involves very infrequent backups (6 month cycle) of very
large amounts of data (30 TB). As such, we don't have much use for timed
jobs because we plan to run it manually once the hard drives have been
retrieved from safe storage every 6 months. The main issue is the ability
for a luddite to be able to switch drives in the autochanger "when the
light stops flashing" without typing anything into any terminal anywhere.
Preparing the drives for first use and then disabling all volumes works
fine with my clunky scripts, but I wonder how to integrate the "benablemag
$thismag 1" command with udev so that a newly inserted drive is enabled by
the system (rather than a bacula job), followed by "bcommand update slots"
or something similar (as this command currently also fails). This should
only occur for drives passing through the /etc/auto.vchanger rule, or
whatever the equivalent is in udev (I'm still very fuzzy on this point).
Then after the customary 3 minute wait, backup would continue with no user
interaction. Rinse and repeat until the job is done.

Sorry this is a little long! Takes me a while to think through it all. If
either of you wants to pick this up as a supported job, we do have some
limited funding available :)

Cheers from Beijing,
Leon


On Wed, Apr 3, 2013 at 8:36 AM, Bill Arlofski <waa-bac...@revpol.com> wrote:

> Leon,
>
> After replying to you earlier today, I spent a little time testing Josh's
> benablemag script, and thought about my "just create a script to run in an
> Admin job" comment.
>
> Thought that it required a little more information.
>
> So, here is my Admin job called "UpdateSlots" which runs before all of my
> other jobs each night.
>
> --[snip]--
> # ----------------
> # Update Slots Job
> # ----------------
> Job {
>   Name = UpdateSlots
>   Client = None
>   Type = Admin
>   FileSet = None
>   Storage = c0
>   Schedule = WeeklyToOffsiteDisk
>   Messages = Standard
>   Priority = 8
>   SpoolData = no
>   Pool = Default
>
>   RunScript {
>     RunsWhen = Before
>     RunsOnClient = no
>     Fail Job On Error = no
>     Command =
> "/etc/bacula/include/mag_and_vol_scripts/auto_enable_disable_vols.sh"
>     Command = "/etc/bacula/include/runbefore-updateslots.sh"
>   }
> }
> --[snip]--
>
> Here is the runbefore-updateslots.sh script that is called:
>
> --[snip]--
> #!/bin/bash
> #
> # waa - 20091110
> # --------------
> BC="/usr/sbin/bconsole"
> CONF="/path/to/bconsole.conf"
> STORAGE="c0"
> DRIVE="0"
>
> $BC -c $CONF << WAAEOF
> update slots storage=$STORAGE drive=$DRIVE
> quit
> WAAEOF
> --[snip]--
>
>
> And here is the auto_enable_disable_vols.sh script I am using starting
> today.
>
> http://www.revpol.com/node/146
>
> Hope this helps - someone. :)
>
> --
> Bill Arlofski
> Reverse Polarity, LLC
>



-- 
陆智诚 | Leon White
绿色和平 | Greenpeace East Asia
+86 186 0692 9781 | Skype: strophy
行动,带来改变。 Positive change through action.
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to