src/dird/msgchan.c
bool send_bootstrap_file(JCR *jcr, BSOCK *sd)
{
   FILE *bs;
   char buf[1000];
   const char *bootstrap = "bootstrap\n";

   Dmsg1(400, "send_bootstrap_file: %s\n", jcr->RestoreBootstrap);
   if (!jcr->RestoreBootstrap) {
      return true;
   }
   bs = bfopen(jcr->RestoreBootstrap, "rb");
   if (!bs) {
      berrno be;
      Jmsg(jcr, M_FATAL, 0, _("Could not open bootstrap file %s: ERR=%s\n"),
         jcr->RestoreBootstrap, be.bstrerror());
      jcr->setJobStatus(JS_ErrorTerminated);
      return false;
   }
   sd->fsend(bootstrap);
   while (fgets(buf, sizeof(buf), bs)) {
      sd->fsend("%s", buf);
   }
   sd->signal(BNET_EOD);
   fclose(bs);
   if (jcr->unlink_bsr) {
      unlink(jcr->RestoreBootstrap);
      jcr->unlink_bsr = false;
   }
   return true;
}
/*
 * Send bootstrap file to Storage daemon.
 *  This is used for restore, verify VolumeToCatalog, migration,
 *    and copy Jobs.
 */
Send bootstrap file to Storage daemon.
This is used for restore, verify VolumeToCatalog, migration,
and copy Jobs.
Send bootstrap file to Storage daemon . This is used for restore verify VolumeToCatalog migration and copy Jobs .
bool send_bootstrap_file(JCR *jcr, BSOCK *sd)
{
   FILE *bs;
   char buf[1000];
   const char *bootstrap = "bootstrap\n";
   Dmsg1(400, "send_bootstrap_file: %s\n", jcr->RestoreBootstrap);
   if (!jcr->RestoreBootstrap) {
      return true;
   }
   bs = bfopen(jcr->RestoreBootstrap, "rb");
   if (!bs) {
      berrno be;
      Jmsg(jcr, M_FATAL, 0, _("Could not open bootstrap file %s: ERR=%s\n"),
         jcr->RestoreBootstrap, be.bstrerror());
      jcr->setJobStatus(JS_ErrorTerminated);
      return false;
   }
   sd->fsend(bootstrap);
   while (fgets(buf, sizeof(buf), bs)) {
      sd->fsend("%s", buf);
   }
   sd->signal(BNET_EOD);
   fclose(bs);
   if (jcr->unlink_bsr) {
      unlink(jcr->RestoreBootstrap);
      jcr->unlink_bsr = false;
   }
   return true;
}
bool send_bootstrap_file ( JCR * jcr , BSOCK * sd ) { FILE * bs ; char buf [ 1000 ] ; const char * bootstrap = " \n " ; Dmsg1 ( 400 , " \n " , jcr -> RestoreBootstrap ) ; if ( ! jcr -> RestoreBootstrap ) { return true ; } bs = bfopen ( jcr -> RestoreBootstrap , " " ) ; if ( ! bs ) { berrno be ; Jmsg ( jcr , M_FATAL , 0 , _ ( " \n " ) , jcr -> RestoreBootstrap , be . bstrerror ( ) ) ; jcr -> setJobStatus ( JS_ErrorTerminated ) ; return false ; } sd -> fsend ( bootstrap ) ; while ( fgets ( buf , sizeof ( buf ) , bs ) ) { sd -> fsend ( " " , buf ) ; } sd -> signal ( BNET_EOD ) ; fclose ( bs ) ; if ( jcr -> unlink_bsr ) { unlink ( jcr -> RestoreBootstrap ) ; jcr -> unlink_bsr = false ; } return true ; }
Send bootstrap file to Storage daemon.
Send bootstrap file to Storage daemon .