The different job types are executed differently and also the protocol and information exchange between the daemons differ depending on job options. Based on a few example jobs the following documentation will try to describe the information exchange.
Job setup and start¶
When a job is started the Bareos Director will invoke RunJob() what will call SetupJob() to initialize the job and then pass it to JobqAdd(). After this has happened the job is in the job-queue waiting for a jobq_server to pick it up and actually run it.
After the jobq_server picks up the job a job_thread is started. That thread does some more setup work and then runs the type-specific job payload.
Simple backup job¶
As there are lots of configuration options that will change the job execution in subtle ways, we’re going to assume several things.
- the Bareos File Daemon is not an active client, so the Bareos Director initiates the connection
- the Bareos File Daemon is not a passive client, so the Bareos File Daemon initiated the connection to the Bareos Storage Daemon
When such a job is run, the Bareos Director connects to the Bareos Storage Daemon and does the initial job setup, then the Bareos Director connects to the Bareos File Daemon to setup and start the job there. The Bareos File Daemon then connects to the Bareos Storage Daemon and sends it data there.
Local copy or migrate job¶
The local copy reads records from one volume and writes them to another volume on the same Bareos Storage Daemon. None of the data is transferred over the network.
When such a job is run, the Bareos Director connects to the Bareos Storage Daemon and tells is what data to read from which volume and what volume the records should be written to.
Remote copy or migrate job¶
The remote copy or migrate basically reads records from one volume and writes them to another one on a different Bareos Storage Daemon. From a networking perspective copy and migrate are not really distinguishable. The main difference is what the director writes to the catalog after the job is finished.
When such a remote copy or migrate job is run, the Bareos Director connects to the reading Bareos Storage Daemon and then to the writing Bareos Storage Daemon. The writing Bareos Storage Daemon is put into listen-mode while the writing Bareos Storage Daemon will essentially run a restore where the data is sent to the writing Bareos Storage Daemon.