I wanted to give this a bump, because with more of my users working
off-site due to COVID-19 the lack of client-initiated backups has become a
major issue.

I think the main question I have is, does *anyone* have client-initiated
backups working in a situation where the client has a dynamic IP? I'd like
to know if this is even possible or if I'm barking up the wrong tree and
need to start looking for a different backup system for these machines.
Bacula has worked great for me where I had control over client IP
allocations and DNS, but this is a case where I don't have control of
either.

The docs as I read them indicate that this should work, that Bacula should
re-use the same TCP connection that the FD made to the director to run the
job, but in practice this isn't what happens -- the director tries to open
a new connection to the FD, by looking up the hostname from the Client { }
stanza.

---------- Forwarded message ---------
From: David Brodbeck <[email protected]>
Date: Tue, Mar 24, 2020 at 12:18 PM
Subject: Client-initiated backup communications problem
To: bacula-users <[email protected]>


I'm having trouble getting client-initiated backups to work. My test system
is a laptop that normally has a fixed IP but is currently on a dynamic one.
I can connect to the FD with bconsole on the client, run the "proxy"
command to get a connection to the director, and launch a job; however,
when the job runs it tries to call the client back directly instead of
going through the proxy, which doesn't work because the client is on a
dynamic IP. I think I'm missing some configuration piece to tell Bacula not
to make a direct connection.

Here are the relevant config file stanzas (scrubbed):

---FD Config---
Director {
  Name = sh-dir
  Password = "XXXXXXX"
  Remote = yes
}

Console {
  Name = sh-fdcons
  DIRPort = 9101
  address = sh.example.net
  Password = "YYYYYYY"
}

Bconsole config on client:
Director {
  Name = eltanin-fd
  DIRport = 9102
  address = localhost
  Password = "notused"
}

Console {
  Name = sh-dir
  Password = "XXXXXXX"
}

Relevant director stanzas:
Console {
  Name = sh-fdcons
  Password = "YYYYYYY"
  CommandACL = run, restore, wait, .status, .jobs, .clients, .storages,
.pools, .filesets, .defaults, .estimate
  jobacl = *all*
  poolacl = *all*
  clientacl = *all*
  storageacl = *all*
  catalogacl = *all*
  filesetacl = *all*
}

Client {
  Name = eltanin-fd
  Address = eltanin.example.net
  FDPort = 9102
  Catalog = MyCatalog
  Password = "XXXXXXX"          # password for FileDaemon
  Job Retention = 60 days
  AutoPrune = yes
  Maximum Concurrent Jobs = 1
}

Job {
  Name = "eltanin"
  Client = eltanin-fd
  JobDefs = "StaffDesktopIncremental"
  FileSet = "eltanin"
}

JobDefs {
  Name = "StaffDesktopIncremental"
  Type = Backup
  Level = Incremental
  Allow Mixed Priority = yes
  Allow Duplicate Jobs = no
  FileSet = "OS X Desktop"
  Schedule = "StaffDesktopIncrementalSked"
  Messages = Standard
  Pool = DataCenterPool
  Accurate = yes
  SpoolAttributes = yes
  Priority = 10
  Write Bootstrap = "/opt/bacula/working/%c.bsr"
  Backups To Keep = 14
  Delete Consolidated Jobs = yes
  Next Pool = DataCenterPool
  Reschedule On Error = yes
  Reschedule Interval = 6 hours
  Reschedule Times = 3
  RunScript {
    RunsWhen = Before
    FailJobOnError = No
    RunsOnClient = No
    Command = "/usr/local/bin/wake-by-host.sh %h %l"
  }
  # On macOS we need to temporarily turn off sleep after WOL, or the machine
  # will go back to sleep faster than a teenager who's hit the snooze
button.
  #
  # Note that we intentionally use /var/run instead of /tmp for the
temporary
  # file; since we're running as root, we need to consider symlink attacks.
  RunScript {
    RunsWhen = Before
    FailJobOnError = No
    RunsOnClient = Yes
    Command = "sh -c \"/usr/bin/pmset -g live | /usr/bin/grep '^ *sleep' |
/usr/bin/sed -E 's/ sleep[[:space:]]+([0-9]+)[^0-9]*/\\1/'
>/var/run/bacula-insomnia.%j && /usr/bin/pmset sleep 0\""
  }
  RunScript {
    RunsWhen = After
    FailJobOnError = No
    RunsOnClient = Yes
    Command = "sh -c \"/usr/bin/pmset sleep `cat
/var/run/bacula-insomnia.%j` && rm /var/run/bacula-insomnia.%j\""
  }
}

-- 
David Brodbeck
System Administrator, Department of Mathematics
University of California, Santa Barbara
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to