Bacula-users

Re: [Bacula-users] Variables in bacula

2010-08-02 16:57:21
Subject: Re: [Bacula-users] Variables in bacula
From: Dan Langille <dan AT langille DOT org>
To: Daniel beas <beasdaniel AT hotmail DOT com>
Date: Mon, 02 Aug 2010 16:54:04 -0400
On 8/2/2010 2:24 PM, Daniel beas wrote:

>  > Date: Mon, 2 Aug 2010 13:54:25 -0400
>  > From: alaric AT metrocast DOT net
>  > To: bacula-users AT lists.sourceforge DOT net
>  > Subject: Re: [Bacula-users] Variables in bacula
>  >
>  > On 08/02/10 13:17, Daniel beas wrote:
>  > >
>  > > Hi to all.
>  > > I have a dsl connection with a dynamic ip and actually i'm resolving it
>  > > with a subdomain from no-ip but sometimes i get this error
>  > > gethostbyname() for host "mydomain.zapto.org" failed:
>  > > ERR=Non-authoritative for host not found, or ServerFail.
>  > > So i'm trying to change the way i get the ip for the Storage daemon by
>  > > getting my public ip with a shell script (ran before the job) and
>  > > putting it in a variable.
>  > >
>  > > IP=`wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address://'
>  > > -e 's/<.*$//'`
>  > >
>  > > The problem i have is how can bacula-dir.conf get the $IP variable?
>  > >
>  > > i tried just this way but it doesn work
>  > > Storage {
>  > > Name = sxxx
>  > > Address = $IP
>  > > SDPort = 9103
>  > > Password = "SHexZ8mwXW4YkbJgu2HpJloZfkuT5Pj5yyWLiPxBhoZy"
>  > > device = dxxx
>  > > Media type = File
>  > > }
>  > >
>  > > and then tried using brackets this way
>  > > Storage {
>  > > Name = sxxx
>  > > Address = {$IP}
>  > > SDPort = 9103
>  > > Password = "SHexZ8mwXW4YkbJgu2HpJloZfkuT5Pj5yyWLiPxBhoZy"
>  > > device = dxxx
>  > > Media type = File
>  > > }
>  > > but looks like bacula thinks there finish the storage resource
>  >
>  > Well, that latter syntax would be wrong for shell expansion; it would be
>  > ${IP}, not {$IP}. But correct shell expansion is moot in the first
>  > place because Bacula does not perform shell expansion when loading its
>  > config files.
>  >
>  > About the only practical way you can do this is to maintain a template
>  > config, generate a "live" config by processing the template and
>  > replacing the IP, then starting Bacula on the live config. So you'd do
>  > something like this:
>  >
>  > # bacula-dir.template
>  > Storage {
>  > Name = sxxx
>  > Address = MYADDRESS
>  > SDPort = 9103
>  > Password = "SHexZ8mwXW4YkbJgu2HpJloZfkuT5Pj5yyWLiPxBhoZy"
>  > device = dxxx
>  > Media type = File
>  > }
>  >
>  > # prepscript
>  > #!/bin/bash
>  > IP=$(whatever means to get IP here)
>  > cat bacula-dir.template | sed -e "s/MYADDRESS/${IP}/" > bacula-dir.conf
>  > /etc/init.d/bacula start
>  >
>  > This step could probably actually be incorporated into your Bacula
>  > startup script.
>  >
>  > You're also going to have to make your Director and your storage daemon
>  > listen on both your internal address and your public IP, unless your
>  > router is taking care of this via NAT.
>  >
>  >
>  > All this said, I can't help but think there has to be an easier way to
>  > do this, but it's hard to tell without knowing what your actual
>  > infrastructure situation is. Do I understand correctly that you are
>  > trying to make backups, over DSL, to a remote storage host on a
>  > dynamic-IP connection somewhere off in the outside world? Or are you
>  > trying to back up remote clients to a local storage daemon over a
>  > dynamic-IP DSL connection? Either way seems likely to be both extremely
>  > unreliable and, more likely than not, infeasibly slow.

> i'm doing backups of local and remote clients (the remote clients doesn't 
> have too much information so there is not a big problem doing that).
> I have remember thah i had used the domain name for the storage because i had 
> used the same storage for all the clients (remote and local) but now i have a 
> storage for every client so i don't have this problem anymore and i can use 
> the local ip address for local backups which are the most important.

Would OpenVPN help here?  That way, each remote client could have the 
same IP address on the VPN.  FYI, this is how I backup remote clients 
even when they have static IP addresses.

-- 
Dan Langille - http://langille.org/

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

<Prev in Thread] Current Thread [Next in Thread>