Session Label
Keywords: developers

#
Session Label

The Session Label is written at the beginning and end of each session as well as the last record on the physical medium. It has the following binary format:

      char Id[32];              /* Bacula Immortal ... */
      uint32_t VerNum;          /* Label version number */
      uint32_t JobId;           /* Job id */
      uint32_t VolumeIndex;     /* sequence no of vol */
      /* Prior to VerNum 11 */
      float64_t write_date;     /* Date this label written */
      /* VerNum 11 and greater */
      btime_t   write_btime;    /* time/date record written */
      /* The following is zero VerNum 11 and greater */
      float64_t write_time;    /* Time this label written */
      char PoolName[128];        /* Pool name */
      char PoolType[128];        /* Pool type */
      char JobName[128];         /* base Job name */
      char ClientName[128];
      /* Added in VerNum 10 */
      char Job[128];             /* Unique Job name */
      char FileSetName[128];     /* FileSet name */
      uint32_t JobType;
      uint32_t JobLevel;

In addition, the EOS label contains:

      /* The remainder are part of EOS label only */
      uint32_t JobFiles;
      uint64_t JobBytes;
      uint32_t start_block;
      uint32_t end_block;
      uint32_t start_file;
      uint32_t end_file;
      uint32_t JobErrors;

In addition, for VerNum greater than 10, the EOS label contains (in addition to the above):

      uint32_t JobStatus          /* Job termination code */

: Note, the LabelType (Volume Label, Volume PreLabel, Session Start Label, ...) is stored in the record FileIndex field and does not appear in the data part of the record. Also, the Stream field of the Record Header contains the JobId. This permits quick filtering without actually reading all the session data in many cases.