/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2012 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
*
* Kern Sibbald, September MM
*
- * Version $Id$
*/
#include "bacula.h"
{ NT_("help"), help_cmd, _("Print help on specific command"),
NT_("add autodisplay automount cancel create delete disable\n\tenable estimate exit gui label list llist"
"\n\tmessages memory mount prune purge python quit query\n\trestore relabel release reload run status"
- "\n\tsetdebug setip show sqlquery time trace unmount umount\n\tupdate use var version wait"), false},
+ "\n\tsetdebug setip show sqlquery time trace unmount\n\tumount update use var version wait"), false},
- { NT_("label"), label_cmd, _("Label a tape"), NT_("storage=<storage> volume=<vol> pool=<pool>"), false},
+ { NT_("label"), label_cmd, _("Label a tape"), NT_("storage=<storage> volume=<vol> pool=<pool> slot=<slot> barcodes"), false},
{ NT_("list"), list_cmd, _("List objects from catalog"),
NT_("pools | jobs | jobtotals | volume | media <pool=pool-name> | files jobid=<nn> | copies jobid=<nn>"), true},
{ NT_("query"), querycmd, _("Query catalog"), NT_(""), false},
{ NT_("restore"), restore_cmd, _("Restore files"),
NT_("where=</path> client=<client> storage=<storage> bootstrap=<file> "
- "restore_job=<job>"
+ "restorejob=<job>"
"\n\tcomment=<text> jobid=<jobid> done select all"), false},
{ NT_("relabel"), relabel_cmd, _("Relabel a tape"),
"\n\t pool=<pool> recycle=<yes/no> slot=<number>\n\t inchanger=<yes/no>"
"\n\t maxvolbytes=<size> maxvolfiles=<nb> maxvoljobs=<nb>"
"\n\t enable=<yes/no> recyclepool=<pool> actiononpurge=<action>"),true},
- { NT_("use"), use_cmd, _("Use catalog xxx"), NT_(""), false},
+ { NT_("use"), use_cmd, _("Use catalog xxx"), NT_("catalog=<catalog>"), false},
{ NT_("var"), var_cmd, _("Does variable expansion"), NT_(""), false},
{ NT_("version"), version_cmd, _("Print Director version"), NT_(""), true},
{ NT_("wait"), wait_cmd, _("Wait until no jobs are running"),
POOL_DBR pr;
MEDIA_DBR mr;
int num, i, max, startnum;
- int first_id = 0;
char name[MAX_NAME_LENGTH];
STORE *store;
int Slot = 0, InChanger = 0;
}
memset(&pr, 0, sizeof(pr));
- memset(&mr, 0, sizeof(mr));
if (!get_pool_dbr(ua, &pr)) {
return 1;
bsnprintf(mr.VolumeName, sizeof(mr.VolumeName), name, i);
mr.Slot = Slot++;
mr.InChanger = InChanger;
- mr.StorageId = store->StorageId;
mr.Enabled = 1;
+ set_storageid_in_mr(store, &mr);
Dmsg1(200, "Create Volume %s\n", mr.VolumeName);
if (!db_create_media_record(ua->jcr, ua->db, &mr)) {
ua->error_msg("%s", db_strerror(ua->db));
return 1;
}
- if (i == startnum) {
- first_id = mr.PoolId;
- }
}
pr.NumVols += num;
Dmsg0(200, "Update pool record.\n");
return 1;
}
-
/*
* Set a new address in a Client resource. We do this only
* if the Console name is the same as the Client name
JCR *jcr = ua->jcr;
int accurate=-1;
- jcr->set_JobLevel(L_FULL);
+ jcr->setJobLevel(L_FULL);
for (int i=1; i<ua->argc; i++) {
if (strcasecmp(ua->argk[i], NT_("client")) == 0 ||
strcasecmp(ua->argk[i], NT_("fd")) == 0) {
}
jcr->job = job;
- jcr->set_JobType(JT_BACKUP);
+ jcr->setJobType(JT_BACKUP);
+ jcr->start_time = time(NULL);
init_jcr_job_record(jcr);
if (!get_or_create_client_record(jcr)) {
return 1;
}
- if (!send_include_list(jcr)) {
- ua->error_msg(_("Error sending include list.\n"));
- goto bail_out;
- }
-
- if (!send_exclude_list(jcr)) {
- ua->error_msg(_("Error sending exclude list.\n"));
- goto bail_out;
- }
-
/* The level string change if accurate mode is enabled */
if (accurate >= 0) {
jcr->accurate = accurate;
goto bail_out;
}
+ if (!send_include_list(jcr)) {
+ ua->error_msg(_("Error sending include list.\n"));
+ goto bail_out;
+ }
+
+ if (!send_exclude_list(jcr)) {
+ ua->error_msg(_("Error sending exclude list.\n"));
+ goto bail_out;
+ }
+
/*
* If the job is in accurate mode, we send the list of
* all files to FD.