[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bacula-devel] delete volume=<volume> yes


Hi,

the attached trivial patch makes the "delete volume" command on the console 
accept a trailing "yes" for non-interactive deletion of volumes.

While deleting volumes may not be a sensible task for many or even most users, 
others (me :)) require non-interactive deletion.

Similar/analog modifications may be sensible for many users for the 
other "delete" statements.

Feel free to use or adapt. You have my signed FLA.

Thx & Best regards
   Bastian

-- 
Collax GmbH . Burkheimer Straße 3 . 79111 Freiburg . Germany
p: +49 (0) 761-45684-24
f: +49 (0) 761-45684-10        www.collax.com

Geschäftsführer: William K. Hite / Boris Nalbach
AG München HRB 158898 . Ust.-IdNr: DE 814464942
\ I'm not as think as you drunk I am.
Index: ua_cmds.c
===================================================================
--- bacula-20080825svn/src/dird/ua_cmds.c	(revision 7509)
+++ bacula-20080825svn/src/dird/ua_cmds.c	(working copy)
@@ -1411,10 +1411,14 @@
       "and all Jobs saved on that volume from the Catalog\n"),
       mr.VolumeName);
 
-   bsnprintf(buf, sizeof(buf), _("Are you sure you want to delete Volume \"%s\"? (yes/no): "),
-      mr.VolumeName);
-   if (!get_yesno(ua, buf)) {
-      return 1;
+   if (find_arg(ua, "yes") >= 0) {
+      ua->pint32_val = 1; /* Have "yes" on command line already" */
+   } else {
+      bsnprintf(buf, sizeof(buf), _("Are you sure you want to delete Volume \"%s\"? (yes/no): "),
+         mr.VolumeName);
+      if (!get_yesno(ua, buf)) {
+         return 1;
+      }
    }
    if (ua->pint32_val) {
       db_delete_media_record(ua->jcr, ua->db, &mr);
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bacula-devel mailing list
Bacula-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/bacula-devel


This mailing list archive is a service of Copilotco.