Release Notes for Bacula 1.31
- Bacula code: Total files = 250 Total lines = 74,376 (*.h *.c *.in)
+ Bacula code: Total files = 251 Total lines = 74,587 (*.h *.c *.in)
Major Changes this Release:
- The database format has changed. Please see below.
jcr->client->hdr.name, fd->msg);
set_jcr_job_status(jcr, JS_ErrorTerminated);
return 0;
- } else {
+ } else if (jcr->db) {
CLIENT_DBR cr;
memset(&cr, 0, sizeof(cr));
bstrncpy(cr.Name, jcr->client->hdr.name, sizeof(cr.Name));
static int estimate_cmd(UAContext *ua, char *cmd)
{
- bsendmsg(ua, "Not yet implemented\n");
+ JOB *job;
+ BSOCK *fd;
+ if (ua->argc < 2) {
+ return 1;
+ }
+ job = (JOB *)GetResWithName(R_JOB, ua->argk[1]);
+ ua->jcr->client = job->client;
+ bsendmsg(ua, _("Connecting to Client %s at %s:%d\n"),
+ job->client->hdr.name, job->client->address, job->client->FDport);
+ if (!connect_to_file_daemon(ua->jcr, 1, 15, 0)) {
+ bsendmsg(ua, _("Failed to connect to Client.\n"));
+ return 1;
+ }
+ fd = ua->jcr->file_bsock;
+
+ if (!send_include_list(ua->jcr)) {
+ bsendmsg(ua, _("Error sending include list.\n"));
+ return 1;
+ }
+
+ if (!send_exclude_list(ua->jcr)) {
+ bsendmsg(ua, _("Error sending exclude list.\n"));
+ return 1;
+ }
+
+ bnet_fsend(fd, "level = full mtime_only=0\n");
+ if (bnet_recv(fd) >= 0) {
+ bsendmsg(ua, "%s", fd->msg);
+ }
+
+ bnet_fsend(fd, "estimate list=1\n");
+ while (bnet_recv(fd) >= 0) {
+ bsendmsg(ua, "%s", fd->msg);
+ }
+
+ bnet_sig(fd, BNET_TERMINATE);
+ bnet_close(fd);
+ ua->jcr->file_bsock = NULL;
+
return 1;
}
jcr->JobStatus = JS_Running;
set_find_options((FF_PKT *)jcr->ff, jcr->incremental, jcr->mtime, jcr->mtime_only);
-
stat = find_files(jcr, (FF_PKT *)jcr->ff, tally_file, (void *)jcr);
return stat;
*/
static int tally_file(FF_PKT *ff_pkt, void *ijcr)
{
- JCR *jcr = (JCR *) ijcr;
+ JCR *jcr = (JCR *)ijcr;
+ ATTR attr;
switch (ff_pkt->type) {
case FT_LNKSAVED: /* Hard linked, file already saved */
- break;
case FT_REGE:
case FT_REG:
case FT_LNK:
ff_pkt->statp.st_size > 0) {
jcr->JobBytes += ff_pkt->statp.st_size;
}
-
- jcr->JobFiles++; /* increment number of files sent */
+ jcr->num_files_examined++;
+ jcr->JobFiles++; /* increment number of files seen */
+ if (jcr->listing) {
+ memcpy(&attr.statp, &ff_pkt->statp, sizeof(struct stat));
+ attr.type = ff_pkt->type;
+ attr.ofname = (POOLMEM *)ff_pkt->fname;
+ attr.olname = (POOLMEM *)ff_pkt->link;
+ print_ls_output(jcr, &attr);
+ }
return 1;
}
static char errmsg[] = "2999 Invalid command\n";
static char no_auth[] = "2998 No Authorization\n";
static char OKinc[] = "2000 OK include\n";
-static char OKest[] = "2000 OK estimate files=%ld bytes=%ld\n";
+static char OKest[] = "2000 OK estimate files=%u bytes=%s\n";
static char OKexc[] = "2000 OK exclude\n";
static char OKlevel[] = "2000 OK level\n";
static char OKbackup[] = "2000 OK backup\n";
static int estimate_cmd(JCR *jcr)
{
BSOCK *dir = jcr->dir_bsock;
+ char ed2[50];
+
+ jcr->listing = 1;
make_estimate(jcr);
- return bnet_fsend(dir, OKest, jcr->num_files_examined, jcr->JobBytes);
+ bnet_fsend(dir, OKest, jcr->num_files_examined,
+ edit_uint64(jcr->JobBytes, ed2));
+ bnet_sig(dir, BNET_EOD);
+ return 1;
}
/*
int incremental; /* set if incremental for SINCE */
time_t mtime; /* begin time for SINCE */
int mtime_only; /* compare only mtime and not ctime as well */
- int status; /* job status */
+ int listing; /* job listing in estimate */
long Ticket; /* Ticket */
int save_level; /* save level */
char *big_buf; /* I/O buffer */