From ef3b3ca66f9c239c869e453996279eafaa89a9f7 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 25 Aug 2007 19:33:46 +0000 Subject: [PATCH] Start some new coding git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5406 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/kernstodo | 13 +++++++++++++ bacula/src/dird/dird_conf.c | 28 +++++++++++++++++++++++++--- bacula/src/dird/dird_conf.h | 2 ++ 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/bacula/kernstodo b/bacula/kernstodo index b184f05c53..eadfb5770c 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -120,6 +120,19 @@ Priority: Projects: +- Pool enhancements + - Access Mode = Read-Only, Read-Write, Unavailable, Destroyed, Offsite + - Pool Type = Copy + - Maximum number of scratch volumes + - Maximum File size + - Next Pool (already have) + - Reclamation threshold + - Reclamation Pool + - Reuse delay (after all files purged from volume before it can be used) + - Copy Pool = xx, yyy (or multiple lines). + - Catalog = xxx + - Allow pool selection during restore. + - Average tape size from Eric SELECT COALESCE(media_avg_size.volavg,0) * count(Media.MediaId) AS volmax, GROUP BY Media.MediaType, Media.PoolId, media_avg_size.volavg count(Media.MediaId) AS volnum, diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index 6f0f63d99c..475df3cdf3 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -368,9 +368,11 @@ static RES_ITEM pool_items[] = { {"migrationlowbytes", store_size, ITEM(res_pool.MigrationLowBytes), 0, 0, 0}, {"nextpool", store_res, ITEM(res_pool.NextPool), R_POOL, 0, 0}, {"storage", store_alist_res, ITEM(res_pool.storage), R_STORAGE, 0, 0}, - {"autoprune", store_bool, ITEM(res_pool.AutoPrune), 0, ITEM_DEFAULT, true}, - {"recycle", store_bool, ITEM(res_pool.Recycle), 0, ITEM_DEFAULT, true}, - {"recyclepool", store_res, ITEM(res_pool.RecyclePool), R_POOL, 0, 0}, + {"autoprune", store_bool, ITEM(res_pool.AutoPrune), 0, ITEM_DEFAULT, true}, + {"recycle", store_bool, ITEM(res_pool.Recycle), 0, ITEM_DEFAULT, true}, + {"recyclepool", store_res, ITEM(res_pool.RecyclePool), R_POOL, 0, 0}, + {"copypool", store_alist_res, ITEM(res_pool.CopyPool), R_POOL, 0, 0}, + {"catalog", store_res, ITEM(res_pool.Catalog), R_CATALOG, 0, 0}, {NULL, NULL, {0}, 0, 0, 0} }; @@ -560,6 +562,7 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm dump_resource(-R_CATALOG, (RES *)res->res_client.catalog, sendit, sock); } break; + case R_DEVICE: dev = &res->res_dev; char ed1[50]; @@ -572,6 +575,7 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm edit_uint64(dev->PoolId, ed1), dev->VolumeName, dev->MediaType); break; + case R_STORAGE: sendit(sock, _("Storage: name=%s address=%s SDport=%d MaxJobs=%u\n" " DeviceName=%s MediaType=%s StorageId=%s\n"), @@ -581,6 +585,7 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm res->res_store.media_type, edit_int64(res->res_store.StorageId, ed1)); break; + case R_CATALOG: sendit(sock, _("Catalog: name=%s address=%s DBport=%d db_name=%s\n" " db_user=%s MutliDBConn=%d\n"), @@ -588,6 +593,7 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm res->res_cat.db_port, res->res_cat.db_name, NPRT(res->res_cat.db_user), res->res_cat.mult_db_connections); break; + case R_JOB: case R_JOBDEFS: sendit(sock, _("%s: name=%s JobType=%d level=%s Priority=%d Enabled=%d\n"), @@ -680,6 +686,7 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm dump_resource(-R_MSGS, (RES *)res->res_job.messages, sendit, sock); } break; + case R_FILESET: { int i, j, k; @@ -755,6 +762,7 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm } break; } + case R_SCHEDULE: if (res->res_sch.run) { int i; @@ -842,6 +850,7 @@ next_run: sendit(sock, _("Schedule: name=%s\n"), res->res_sch.hdr.name); } break; + case R_POOL: sendit(sock, _("Pool: name=%s PoolType=%s\n"), res->res_pool.hdr.name, res->res_pool.pool_type); @@ -874,6 +883,9 @@ next_run: if (res->res_pool.RecyclePool) { sendit(sock, _(" RecyclePool=%s\n"), res->res_pool.RecyclePool->name()); } + if (res->res_pool.Catalog) { + sendit(sock, _(" Catalog=%s\n"), res->res_pool.Catalog->name()); + } if (res->res_pool.storage) { STORE *store; foreach_alist(store, res->res_pool.storage) { @@ -881,7 +893,16 @@ next_run: dump_resource(-R_STORAGE, (RES *)store, sendit, sock); } } + if (res->res_pool.CopyPool) { + POOL *copy; + foreach_alist(copy, res->res_pool.CopyPool) { + sendit(sock, _(" --> ")); + dump_resource(-R_POOL, (RES *)copy, sendit, sock); + } + } + break; + case R_MSGS: sendit(sock, _("Messages: name=%s\n"), res->res_msgs.hdr.name); if (res->res_msgs.mail_cmd) @@ -889,6 +910,7 @@ next_run: if (res->res_msgs.operator_cmd) sendit(sock, _(" opcmd=%s\n"), res->res_msgs.operator_cmd); break; + default: sendit(sock, _("Unknown resource type %d in dump_resource.\n"), type); break; diff --git a/bacula/src/dird/dird_conf.h b/bacula/src/dird/dird_conf.h index 425db2216f..03d50eb706 100644 --- a/bacula/src/dird/dird_conf.h +++ b/bacula/src/dird/dird_conf.h @@ -533,6 +533,8 @@ public: bool AutoPrune; /* default for pool auto prune */ bool Recycle; /* default for media recycle yes/no */ POOL *RecyclePool; /* RecyclePool destination when media is purged */ + alist *CopyPool; /* List of copy pools */ + CAT *Catalog; /* Catalog to be used */ /* Methods */ char *name() const; }; -- 2.39.5