From: Kern Sibbald Date: Sat, 23 May 2009 20:44:37 +0000 (+0000) Subject: Create Client record in database at startup -- makes bat work better X-Git-Tag: Release-3.0.2~208 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cd3fa05c7606344cba764e666d1d9557a3571e11;p=bacula%2Fbacula Create Client record in database at startup -- makes bat work better git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8858 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/dird.c b/bacula/src/dird/dird.c index edf4a650be..fc59364e1f 100644 --- a/bacula/src/dird/dird.c +++ b/bacula/src/dird/dird.c @@ -961,10 +961,22 @@ static bool check_catalog() } } + /* Ensure basic client record is in DB */ + CLIENT *client; + foreach_res(client, R_CLIENT) { + CLIENT_DBR cr; + memset(&cr, 0, sizeof(cr)); + bstrncpy(cr.Name, client->name(), sizeof(cr.Name)); + db_create_client_record(NULL, db, &cr); + } + + /* Ensure basic storage record is in DB */ STORE *store; foreach_res(store, R_STORAGE) { STORAGE_DBR sr; MEDIATYPE_DBR mr; + memset(&sr, 0, sizeof(sr)); + memset(&mr, 0, sizeof(mr)); if (store->media_type) { bstrncpy(mr.MediaType, store->media_type, sizeof(mr.MediaType)); mr.ReadOnly = 0; diff --git a/bacula/technotes b/bacula/technotes index 17336fc8a7..3a70e7b2f5 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -3,8 +3,8 @@ General: 23May09 +kes Create Client record in database at startup -- makes bat work better. kes Turn off useless End of file message during restore. -======= kes When doing a tree selection restore, look at the PurgedFiles column in the first JobId, and if non-zero, the Job was purged, so do not do selection.