Exemplo n.º 1
0
/*
 *   Append Data command
 *     Open Data Channel and receive Data for archiving
 *     Write the Data to the archive device
 */
static bool append_data_cmd(JCR *jcr)
{
   BSOCK *fd = jcr->file_bsock;

   Dmsg1(120, "Append data: %s", fd->msg);
   if (jcr->session_opened) {
      Dmsg1(110, "<bfiled: %s", fd->msg);
      jcr->set_JobType(JT_BACKUP);
      if (do_append_data(jcr)) {
         return true;
      } else {
         pm_strcpy(jcr->errmsg, _("Append data error.\n"));
         bnet_suppress_error_messages(fd, 1); /* ignore errors at this point */
         fd->fsend(ERROR_append);
      }
   } else {
      pm_strcpy(jcr->errmsg, _("Attempt to append on non-open session.\n"));
      fd->fsend(NOT_opened);
   }
   return false;
}
Exemplo n.º 2
0
/*
 * Replicate data.
 *    Open Data Channel and receive Data for archiving
 *    Write the Data to the archive device
 */
static bool replicate_data(JCR *jcr)
{
   BSOCK *sd = jcr->store_bsock;

   Dmsg1(120, "Replicate data: %s", sd->msg);
   if (jcr->session_opened) {
      Dmsg1(110, "<stored: %s", sd->msg);
      if (do_append_data(jcr, sd, "SD")) {
         return true;
      } else {
         pm_strcpy(jcr->errmsg, _("Replicate data error.\n"));
         bnet_suppress_error_messages(sd, 1); /* ignore errors at this point */
         sd->fsend(ERROR_replicate);
      }
   } else {
      pm_strcpy(jcr->errmsg, _("Attempt to replicate on non-open session.\n"));
      sd->fsend(NOT_opened);
   }

   return false;
}