src/findlib/find_one.c
bool has_file_changed(JCR *jcr, FF_PKT *ff_pkt)
{
   struct stat statp;
   Dmsg1(500, "has_file_changed fname=%s\n",ff_pkt->fname);

   if (ff_pkt->type != FT_REG) { /* not a regular file */
      return false;
   }

   if (lstat(ff_pkt->fname, &statp) != 0) {
      berrno be;
      Jmsg(jcr, M_WARNING, 0,
           _("Cannot stat file %s: ERR=%s\n"),ff_pkt->fname,be.bstrerror());
      return true;
   }

   if (statp.st_mtime != ff_pkt->statp.st_mtime) {
      Jmsg(jcr, M_ERROR, 0, _("%s mtime changed during backup.\n"), ff_pkt->fname);
      Dmsg3(50, "%s mtime (%lld) changed during backup (%lld).\n", ff_pkt->fname,
            (int64_t)ff_pkt->statp.st_mtime, (int64_t)statp.st_mtime);
      return true;
   }

   if (statp.st_ctime != ff_pkt->statp.st_ctime) {
      Jmsg(jcr, M_ERROR, 0, _("%s ctime changed during backup.\n"), ff_pkt->fname);
      Dmsg3(50, "%s ctime (%lld) changed during backup (%lld).\n", ff_pkt->fname,
            (int64_t)ff_pkt->statp.st_ctime, (int64_t)statp.st_ctime);
      return true;
   }

   if ((int64_t)statp.st_size != (int64_t)ff_pkt->statp.st_size) {
      Jmsg(jcr, M_ERROR, 0, _("%s size of %lld changed during backup to %lld.n"),ff_pkt->fname,
         (int64_t)ff_pkt->statp.st_size, (int64_t)statp.st_size);
      Dmsg3(50, "%s size (%lld) changed during backup (%lld).\n", ff_pkt->fname,
            (int64_t)ff_pkt->statp.st_size, (int64_t)statp.st_size);
      return true;
   }

   return false;
}
/* check if a file have changed during backup and display an error */
check if a file have changed during backup and display an error
check if a file have changed during backup and display an error
bool has_file_changed(JCR *jcr, FF_PKT *ff_pkt)
{
   struct stat statp;
   Dmsg1(500, "has_file_changed fname=%s\n",ff_pkt->fname);
   if (ff_pkt->type != FT_REG) { 
      return false;
   }
   if (lstat(ff_pkt->fname, &statp) != 0) {
      berrno be;
      Jmsg(jcr, M_WARNING, 0,
           _("Cannot stat file %s: ERR=%s\n"),ff_pkt->fname,be.bstrerror());
      return true;
   }
   if (statp.st_mtime != ff_pkt->statp.st_mtime) {
      Jmsg(jcr, M_ERROR, 0, _("%s mtime changed during backup.\n"), ff_pkt->fname);
      Dmsg3(50, "%s mtime (%lld) changed during backup (%lld).\n", ff_pkt->fname,
            (int64_t)ff_pkt->statp.st_mtime, (int64_t)statp.st_mtime);
      return true;
   }
   if (statp.st_ctime != ff_pkt->statp.st_ctime) {
      Jmsg(jcr, M_ERROR, 0, _("%s ctime changed during backup.\n"), ff_pkt->fname);
      Dmsg3(50, "%s ctime (%lld) changed during backup (%lld).\n", ff_pkt->fname,
            (int64_t)ff_pkt->statp.st_ctime, (int64_t)statp.st_ctime);
      return true;
   }
   if ((int64_t)statp.st_size != (int64_t)ff_pkt->statp.st_size) {
      Jmsg(jcr, M_ERROR, 0, _("%s size of %lld changed during backup to %lld.n"),ff_pkt->fname,
         (int64_t)ff_pkt->statp.st_size, (int64_t)statp.st_size);
      Dmsg3(50, "%s size (%lld) changed during backup (%lld).\n", ff_pkt->fname,
            (int64_t)ff_pkt->statp.st_size, (int64_t)statp.st_size);
      return true;
   }
   return false;
}
bool has_file_changed ( JCR * jcr , FF_PKT * ff_pkt ) { struct stat statp ; Dmsg1 ( 500 , " \n " , ff_pkt -> fname ) ; if ( ff_pkt -> type != FT_REG ) { return false ; } if ( lstat ( ff_pkt -> fname , & statp ) != 0 ) { berrno be ; Jmsg ( jcr , M_WARNING , 0 , _ ( " \n " ) , ff_pkt -> fname , be . bstrerror ( ) ) ; return true ; } if ( statp . st_mtime != ff_pkt -> statp . st_mtime ) { Jmsg ( jcr , M_ERROR , 0 , _ ( " \n " ) , ff_pkt -> fname ) ; Dmsg3 ( 50 , " \n " , ff_pkt -> fname , ( int64_t ) ff_pkt -> statp . st_mtime , ( int64_t ) statp . st_mtime ) ; return true ; } if ( statp . st_ctime != ff_pkt -> statp . st_ctime ) { Jmsg ( jcr , M_ERROR , 0 , _ ( " \n " ) , ff_pkt -> fname ) ; Dmsg3 ( 50 , " \n " , ff_pkt -> fname , ( int64_t ) ff_pkt -> statp . st_ctime , ( int64_t ) statp . st_ctime ) ; return true ; } if ( ( int64_t ) statp . st_size != ( int64_t ) ff_pkt -> statp . st_size ) { Jmsg ( jcr , M_ERROR , 0 , _ ( " " ) , ff_pkt -> fname , ( int64_t ) ff_pkt -> statp . st_size , ( int64_t ) statp . st_size ) ; Dmsg3 ( 50 , " \n " , ff_pkt -> fname , ( int64_t ) ff_pkt -> statp . st_size , ( int64_t ) statp . st_size ) ; return true ; } return false ; }
check if a file have changed during backup and display an error
check if a file have changed during backup and display an error
/* not a regular file */