X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fdird%2Fbackup.c;h=f4eba70dd5948242e428a7d90f7d6dc11f99992c;hb=f183afa93772e5f5b3951407bce839b951dede96;hp=39f9ce56d5c4d5b61dd89a2b6c583cd48c4b4a49;hpb=e461a82dda27533d73f37d6596ebb4923d5f22e7;p=bacula%2Fbacula diff --git a/bacula/src/dird/backup.c b/bacula/src/dird/backup.c index 39f9ce56d5..f4eba70dd5 100644 --- a/bacula/src/dird/backup.c +++ b/bacula/src/dird/backup.c @@ -13,24 +13,18 @@ * * Version $Id$ */ - /* Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License + version 2 as ammended with additional clauses defined in the + file LICENSE in the main source directory. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + the file LICENSE for additional details. */ @@ -176,7 +170,10 @@ bool do_backup(JCR *jcr) return false; } /* - * Now start a Storage daemon message thread + * Now start a Storage daemon message thread. Note, + * this thread is used to provide the catalog services + * for the backup job, including inserting the attributes + * into the catalog. See catalog_update() in catreq.c */ if (!start_storage_daemon_message_thread(jcr)) { return false; @@ -211,7 +208,6 @@ bool do_backup(JCR *jcr) store->SDDport = store->SDport; } -#ifdef HAVE_TLS /* TLS Requirement */ if (store->tls_enable) { if (store->tls_require) { @@ -220,7 +216,6 @@ bool do_backup(JCR *jcr) tls_need = BNET_TLS_OK; } } -#endif bnet_fsend(fd, storaddr, store->address, store->SDDport, tls_need); @@ -326,12 +321,14 @@ void backup_cleanup(JCR *jcr, int TermCode) const char *term_msg; int msg_type; MEDIA_DBR mr; + CLIENT_DBR cr; double kbps, compression; utime_t RunTime; Dmsg2(100, "Enter backup_cleanup %d %c\n", TermCode, TermCode); dequeue_messages(jcr); /* display any queued messages */ memset(&mr, 0, sizeof(mr)); + memset(&cr, 0, sizeof(cr)); set_jcr_job_status(jcr, TermCode); update_job_end_record(jcr); /* update database */ @@ -342,6 +339,12 @@ void backup_cleanup(JCR *jcr, int TermCode) set_jcr_job_status(jcr, JS_ErrorTerminated); } + bstrncpy(cr.Name, jcr->client->hdr.name, sizeof(cr.Name)); + if (!db_get_client_record(jcr, jcr->db, &cr)) { + Jmsg(jcr, M_WARNING, 0, _("Error getting client record for stats: %s"), + db_strerror(jcr->db)); + } + bstrncpy(mr.VolumeName, jcr->VolumeName, sizeof(mr.VolumeName)); if (!db_get_media_record(jcr, jcr->db, &mr)) { Jmsg(jcr, M_WARNING, 0, _("Error getting Media record for Volume \"%s\": ERR=%s"), @@ -483,7 +486,7 @@ void backup_cleanup(JCR *jcr, int TermCode) " JobId: %d\n" " Job: %s\n" " Backup Level: %s%s\n" -" Client: %s\n" +" Client: \"%s\" %s\n" " FileSet: \"%s\" %s\n" " Pool: \"%s\"\n" " Storage: \"%s\"\n" @@ -510,7 +513,7 @@ void backup_cleanup(JCR *jcr, int TermCode) jcr->jr.JobId, jcr->jr.Job, level_to_str(jcr->JobLevel), jcr->since, - jcr->client->hdr.name, + jcr->client->hdr.name, cr.Uname, jcr->fileset->hdr.name, jcr->FSCreateTime, jcr->pool->hdr.name, jcr->store->hdr.name,