]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/bcopy.c
Use rentrant mysql lib, eliminate race in sql_list, Win32 streams, misc see kes-1.31
[bacula/bacula] / bacula / src / stored / bcopy.c
index 58cec0eb69189c605dfbc3372400ae1f687f78ea..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;
@@ -54,12 +53,14 @@ char *configfile;
 static void usage()
 {
    fprintf(stderr, _(
-"\nVersion: " VERSION " (" DATE ")\n\n"
+"\nVersion: " VERSION " (" BDATE ")\n\n"
 "Usage: bcopy [-d debug_level] <input-archive> <output-archive>\n"
 "       -b bootstrap      specify a bootstrap file\n"
 "       -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,14 +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);
 
-   fprintf(stderr, "\n\nPlease don't use this program.\n\
-It is currently under development and does not work.\n\n");
-
-   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);
@@ -98,6 +98,15 @@ It is currently under development and does not work.\n\n");
            verbose++;
            break;
 
+         case 'i':                    /* input Volume name */
+           iVolumeName = optarg;
+           break;
+
+         case 'o':                    /* output Volume name */
+           oVolumeName = optarg;
+           break;
+
+
          case 'w':
            wd = optarg;
            break;
@@ -125,14 +134,14 @@ It is currently under development and does not work.\n\n");
    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);     
@@ -147,7 +156,7 @@ It is currently under development and does not work.\n\n");
       exit(1);
    }
    unlock_device(out_dev);
-   if (!acquire_device_for_append(out_jcr, out_dev, out_block)) {
+   if (!(out_dev=acquire_device_for_append(out_jcr, out_dev, out_block))) {
       free_block(out_block);
       free_jcr(in_jcr);
       exit(1);