if (ok) {
mr.PoolId = pr.PoolId;
mr.StorageId = jcr->wstore->StorageId;
- ok = find_next_volume_for_append(jcr, &mr, index, true /*permit create new vol*/);
+ ok = find_next_volume_for_append(jcr, &mr, index, fnv_create_vol, fnv_prune);
Dmsg3(050, "find_media ok=%d idx=%d vol=%s\n", ok, index, mr.VolumeName);
}
/*
-/*
- * Includes specific to the Director
- *
- * Kern Sibbald, December MM
- *
- * Version $Id$
- */
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2007 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.
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
*/
+/*
+ * Includes specific to the Director
+ *
+ * Kern Sibbald, December MM
+ *
+ * Version $Id$
+ */
#include "lib/runscript.h"
#include "dird_conf.h"
int tot_ids; /* total to process */
};
+/* Flags for find_next_volume_for_append() */
+enum {
+ fnv_create_vol = true,
+ fnv_no_create_vol = false,
+ fnv_prune = true,
+ fnv_no_prune = false
+};
+
+
+
#include "protos.h"
* MEDIA_DBR mr with PoolId set
* create -- whether or not to create a new volume
*/
-int find_next_volume_for_append(JCR *jcr, MEDIA_DBR *mr, int index, bool create)
+int find_next_volume_for_append(JCR *jcr, MEDIA_DBR *mr, int index,
+ bool create, bool prune)
{
int retry = 0;
bool ok;
* 4. Try pruning Volumes
*/
Dmsg0(150, "Call prune_volumes\n");
- prune_volumes(jcr, mr);
+ if (prune) {
+ prune_volumes(jcr, mr);
+ }
ok = recycle_oldest_purged_volume(jcr, InChanger, mr);
if (!ok) {
Dmsg4(050, "after prune volumes_vol ok=%d index=%d InChanger=%d Vstat=%s\n",
/* Find oldest volume to recycle */
ok = db_find_next_volume(jcr, jcr->db, -1, InChanger, mr);
Dmsg1(400, "Find oldest=%d\n", ok);
- if (ok) {
+ if (ok && prune) {
UAContext *ua;
Dmsg0(400, "Try purge.\n");
/*
extern void wait_for_storage_daemon_termination(JCR *jcr);
/* next_vol.c */
-int find_next_volume_for_append(JCR *jcr, MEDIA_DBR *mr, int index, bool create);
+int find_next_volume_for_append(JCR *jcr, MEDIA_DBR *mr, int index,
+ bool create, bool purge);
bool has_volume_expired(JCR *jcr, MEDIA_DBR *mr);
void check_if_volume_valid_or_recyclable(JCR *jcr, MEDIA_DBR *mr, const char **reason);
mr.PoolId = jcr->jr.PoolId;
get_job_storage(&store, job, run);
mr.StorageId = store.store->StorageId;
- if (!find_next_volume_for_append(jcr, &mr, 1, false/*no create*/)) {
+ if (!find_next_volume_for_append(jcr, &mr, 1, fnv_no_create_vol, fnv_prune)) {
bsendmsg(ua, _("Could not find next Volume for Job %s (%s, %s).\n"),
job->hdr.name, pr.Name, level_to_str(run->level));
} else {
mr.StorageId = sp->store->StorageId;
jcr->wstore = sp->store;
Dmsg0(250, "call find_next_volume_for_append\n");
- ok = find_next_volume_for_append(jcr, &mr, 1, false/*no create*/);
+ ok = find_next_volume_for_append(jcr, &mr, 1, fnv_no_create_vol, fnv_no_prune);
}
if (!ok) {
bstrncpy(mr.VolumeName, "*unknown*", sizeof(mr.VolumeName));
#undef VERSION
#define VERSION "2.1.6"
-#define BDATE "24 March 2007"
-#define LSMDATE "24Mar07"
+#define BDATE "25 March 2007"
+#define LSMDATE "25Mar07"
#define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n"
#define BYEAR "2007" /* year for copyright messages in progs */
Technical notes on version 2.1
General:
+25Mar07
+kes Implement code to turn off pruning in obtaining the next volume.
+ Pruning is turned off for the status dir command, but turned on
+ for SD requests and for the list nextvolume command.
24Mar07
kes Correct Qmsg() that was not updated correctly when committing a
previous change (probably the recent TLS patch).