src/dird/ua_cmds.c
static int delete_cmd(UAContext *ua, const char *cmd)
{
   static const char *keywords[] = {
      NT_("volume"),
      NT_("pool"),
      NT_("jobid"),
      NT_("snapshot"),
      NT_("client"),
      NULL};

   /* Deleting large jobs can take time! */
   if (!open_new_client_db(ua)) {
      return 1;
   }

   switch (find_arg_keyword(ua, keywords)) {
   case 0:
      delete_volume(ua);
      return 1;
   case 1:
      delete_pool(ua);
      return 1;
   case 2:
      int i;
      while ((i=find_arg(ua, "jobid")) > 0) {
         delete_job(ua);
         *ua->argk[i] = 0;         /* zap keyword already visited */
      }
      return 1;
   case 3:
      delete_snapshot(ua);
      return 1;
   case 4:
      delete_client(ua);
      return 1;
   default:
      break;
   }

   ua->warning_msg(_(
"In general it is not a good idea to delete either a\n"
"Pool or a Volume since they may contain data.\n\n"));

   switch (do_keyword_prompt(ua, _("Choose catalog item to delete"), keywords)) {
   case 0:
      delete_volume(ua);
      break;
   case 1:
      delete_pool(ua);
      break;
   case 2:
      delete_job(ua);
      return 1;
   case 3:
      delete_snapshot(ua);
      return 1;
   case 4:
      delete_client(ua);
      return 1;
   default:
      ua->warning_msg(_("Nothing done.\n"));
      break;
   }
   return 1;
}
/*
 * Delete Pool records (should purge Media with it).
 *
 *  delete pool=<pool-name>
 *  delete volume pool=<pool-name> volume=<name>
 *  delete jobid=xxx
 */
Delete Pool records (should purge Media with it).
Delete Pool records ( should purge Media with it ) .
static int delete_cmd(UAContext *ua, const char *cmd)
{
   static const char *keywords[] = {
      NT_("volume"),
      NT_("pool"),
      NT_("jobid"),
      NT_("snapshot"),
      NT_("client"),
      NULL};
   if (!open_new_client_db(ua)) {
      return 1;
   }
   switch (find_arg_keyword(ua, keywords)) {
   case 0:
      delete_volume(ua);
      return 1;
   case 1:
      delete_pool(ua);
      return 1;
   case 2:
      int i;
      while ((i=find_arg(ua, "jobid")) > 0) {
         delete_job(ua);
         *ua->argk[i] = 0;         
      }
      return 1;
   case 3:
      delete_snapshot(ua);
      return 1;
   case 4:
      delete_client(ua);
      return 1;
   default:
      break;
   }
   ua->warning_msg(_(
"In general it is not a good idea to delete either a\n"
"Pool or a Volume since they may contain data.\n\n"));
   switch (do_keyword_prompt(ua, _("Choose catalog item to delete"), keywords)) {
   case 0:
      delete_volume(ua);
      break;
   case 1:
      delete_pool(ua);
      break;
   case 2:
      delete_job(ua);
      return 1;
   case 3:
      delete_snapshot(ua);
      return 1;
   case 4:
      delete_client(ua);
      return 1;
   default:
      ua->warning_msg(_("Nothing done.\n"));
      break;
   }
   return 1;
}
static int delete_cmd ( UAContext * ua , const char * cmd ) { static const char * keywords [ ] = { NT_ ( " " ) , NT_ ( " " ) , NT_ ( " " ) , NT_ ( " " ) , NT_ ( " " ) , NULL } ; if ( ! open_new_client_db ( ua ) ) { return 1 ; } switch ( find_arg_keyword ( ua , keywords ) ) { case 0 : delete_volume ( ua ) ; return 1 ; case 1 : delete_pool ( ua ) ; return 1 ; case 2 : int i ; while ( ( i = find_arg ( ua , " " ) ) > 0 ) { delete_job ( ua ) ; * ua -> argk [ i ] = 0 ; } return 1 ; case 3 : delete_snapshot ( ua ) ; return 1 ; case 4 : delete_client ( ua ) ; return 1 ; default : break ; } ua -> warning_msg ( _ ( " \n " " \n \n " ) ) ; switch ( do_keyword_prompt ( ua , _ ( " " ) , keywords ) ) { case 0 : delete_volume ( ua ) ; break ; case 1 : delete_pool ( ua ) ; break ; case 2 : delete_job ( ua ) ; return 1 ; case 3 : delete_snapshot ( ua ) ; return 1 ; case 4 : delete_client ( ua ) ; return 1 ; default : ua -> warning_msg ( _ ( " \n " ) ) ; break ; } return 1 ; }
Delete Pool records (should purge Media with it).
Delete Pool records ( should purge Media with it ) .
/* Deleting large jobs can take time! */ /* zap keyword already visited */