]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/bcopy.c
Simplify two messages in acquire.c
[bacula/bacula] / bacula / src / stored / bcopy.c
index a8057eea54a89c61166d9b1a1a4d788bf77a2b29..11b55215323e45df140c5d724807d349bd05577b 100644 (file)
@@ -41,7 +41,6 @@ static JCR *in_jcr;                  /* input jcr */
 static JCR *out_jcr;                  /* output jcr */
 static BSR *bsr = NULL;
 static char *wd = "/tmp";
-static int verbose = 0;
 static int list_records = 0;
 static uint32_t records = 0;
 static uint32_t jobs = 0;
@@ -60,6 +59,8 @@ static void usage()
 "       -c <file>         specify configuration file\n"
 "       -dnn              set debug level to nn\n"
 "       -v                verbose\n"
+"       -i                specify input Volume names (separated by |)\n"
+"       -o                specify output Volume names (separated by |)\n"
 "       -w dir            specify working directory (default /tmp)\n"
 "       -?                print this message\n\n"));
    exit(1);
@@ -68,11 +69,13 @@ static void usage()
 int main (int argc, char *argv[])
 {
    int ch;
+   char *iVolumeName = NULL;
+   char *oVolumeName = NULL;
 
    my_name_is(argc, argv, "bscan");
    init_msg(NULL, NULL);
 
-   while ((ch = getopt(argc, argv, "b:c:d:mn:p:rsu:vw:?")) != -1) {
+   while ((ch = getopt(argc, argv, "b:c:d:mn:p:rsu:vV:w:?")) != -1) {
       switch (ch) {
          case 'b':
            bsr = parse_bsr(NULL, optarg);
@@ -95,6 +98,15 @@ int main (int argc, char *argv[])
            verbose++;
            break;
 
+         case 'i':                    /* input Volume name */
+           iVolumeName = optarg;
+           break;
+
+         case 'o':                    /* output Volume name */
+           oVolumeName = optarg;
+           break;
+
+
          case 'w':
            wd = optarg;
            break;
@@ -122,14 +134,14 @@ int main (int argc, char *argv[])
    parse_config(configfile);
 
    /* Setup and acquire input device for reading */
-   in_jcr = setup_jcr("bcopy", argv[0], bsr);
+   in_jcr = setup_jcr("bcopy", argv[0], bsr, iVolumeName);
    in_dev = setup_to_access_device(in_jcr, 1);  /* read device */
    if (!in_dev) { 
       exit(1);
    }
 
    /* Setup output device for writing */
-   out_jcr = setup_jcr("bcopy", argv[1], bsr);
+   out_jcr = setup_jcr("bcopy", argv[1], bsr, oVolumeName);
    out_dev = setup_to_access_device(out_jcr, 0);   /* no acquire */  
    if (!out_dev) { 
       exit(1);