bool have_full;
bool do_full = false;
bool do_diff = false;
- time_t now;
+ utime_t now;
utime_t last_full_time;
utime_t last_diff_time;
case L_INCREMENTAL:
POOLMEM *stime = get_pool_memory(PM_MESSAGE);
/* Look up start time of last Full job */
- now = time(NULL);
+ now = (utime_t)time(NULL);
jcr->jr.JobId = 0; /* flag to return since time */
have_full = db_find_job_start_time(jcr, jcr->db, &jcr->jr, &jcr->stime);
/* If there was a successful job, make sure it is recent enough */
if (strcmp(job->name(), djcr->job->name()) == 0) {
bool cancel_queued = false;
if (job->DuplicateJobProximity > 0) {
- time_t now = time(NULL);
+ utime_t now = (utime_t)time(NULL);
if ((now - djcr->start_time) > job->DuplicateJobProximity) {
continue; /* not really a duplicate */
}
db_lock(ua->db);
Mmsg(query, "DELETE FROM JobHistory WHERE JobTDate < %s",
- edit_uint64(now - retention, ed1));
+ edit_int64(now - retention, ed1));
db_sql_query(ua->db, query.c_str(), NULL, NULL);
db_unlock(ua->db);
now = (utime_t)time(NULL);
/* Select Jobs -- for counting */
- Mmsg(query, count_select_job, edit_uint64(now - period, ed1),
+ Mmsg(query, count_select_job, edit_int64(now - period, ed1),
edit_int64(cr.ClientId, ed2));
Dmsg3(050, "select now=%u period=%u sql=%s\n", (uint32_t)now,
(uint32_t)period, query.c_str());
del.JobId = (JobId_t *)malloc(sizeof(JobId_t) * del.max_ids);
/* Now process same set but making a delete list */
- Mmsg(query, select_job, edit_uint64(now - period, ed1),
+ Mmsg(query, select_job, edit_int64(now - period, ed1),
edit_int64(cr.ClientId, ed2));
db_sql_query(ua->db, query.c_str(), file_delete_handler, (void *)&del);
* Select all files that are older than the JobRetention period
* and stuff them into the "DeletionCandidates" table.
*/
- edit_uint64(now - period, ed1);
+ edit_int64(now - period, ed1);
Mmsg(query, insert_delcand, (char)JobType, ed1,
edit_int64(cr.ClientId, ed2));
if (!db_sql_query(ua->db, query.c_str(), NULL, (void *)NULL)) {
edit_int64(mr->MediaId, ed1);
period = mr->VolRetention;
now = (utime_t)time(NULL);
- edit_uint64(now-period, ed2);
+ edit_int64(now-period, ed2);
Mmsg(query, sel_JobMedia, ed1, ed2);
- Dmsg3(250, "Now=%d period=%d now-period=%d\n", (int)now, (int)period,
- (int)(now-period));
+ Dmsg3(250, "Now=%d period=%d now-period=%s\n", (int)now, (int)period,
+ ed2);
Dmsg1(050, "Query=%s\n", query.c_str());
if (!db_sql_query(ua->db, query.c_str(), file_delete_handler, (void *)del)) {
break;
}
bstrncpy(lastVolume, dcr->VolumeName, sizeof(lastVolume));
- if (dcr->can_i_use_volume()) {
+ if (dcr->can_i_write_volume()) {
Dmsg1(100, "Call reserve_volume. Vol=%s\n", dcr->VolumeName);
if (reserve_volume(dcr, dcr->VolumeName) == NULL) {
Dmsg2(100, "Could not reserve volume %s on %s\n", dcr->VolumeName,
void clear_reserved();
void set_reserved();
void unreserve_device();
+
+ /* Methods in vol_mgr.c */
bool can_i_use_volume();
+ bool can_i_write_volume();
/* Methods in mount.c */
bool mount_next_write_volume();
VOLRES *find_volume(const char *VolumeName)
{
VOLRES vol, *fvol;
+
+ if (vol_list->empty()) {
+ return NULL;
+ }
/* Do not lock reservations here */
lock_volumes();
vol.vol_name = bstrdup(VolumeName);
return fvol;
}
+/*
+ * Search for a Volume name in the read Volume list.
+ *
+ * Returns: VOLRES entry on success
+ * NULL if the Volume is not in the list
+ */
+static VOLRES *find_read_volume(const char *VolumeName)
+{
+ VOLRES vol, *fvol;
+
+ if (read_vol_list->empty()) {
+ return NULL;
+ }
+ /* Do not lock reservations here */
+ lock_read_volumes();
+ vol.vol_name = bstrdup(VolumeName);
+ /* Note, we do want a simple my_compare on volume name only here */
+ fvol = (VOLRES *)read_vol_list->binary_search(&vol, my_compare);
+ free(vol.vol_name);
+ Dmsg2(dbglvl, "find_read_vol=%s found=%d\n", VolumeName, fvol!=NULL);
+ unlock_read_volumes();
+ return fvol;
+}
+
+
/*
* Free a Volume from the Volume list if it is no longer used
* Note, for tape drives we want to remember where the Volume
}
}
+/*
+ * Determine if caller can write on volume
+ */
+bool DCR::can_i_write_volume()
+{
+ VOLRES *vol;
+
+ lock_read_volumes();
+ vol = find_read_volume(VolumeName);
+ unlock_read_volumes();
+ if (vol) {
+ Dmsg1(100, "Found in read list; cannot write vol=%s\n", VolumeName);
+ return false;
+ }
+ return can_i_use_volume();
+}
+
+/*
+ * Determine if caller can read or write volume
+ */
bool DCR::can_i_use_volume()
{
bool rtn = true;
#undef VERSION
#define VERSION "2.5.17"
-#define BDATE "23 October 2008"
-#define LSMDATE "23Oct08"
+#define BDATE "24 October 2008"
+#define LSMDATE "24Oct08"
#define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
#define BYEAR "2008" /* year for copyright messages in progs */
--with-db-port
enhancement to wait command: wait mount ...
parse config
-
dbport in dbcheck
dbdriver
filepattern (restore with regex in bsr)
libtool
-
remove reader/writer in FOPTS????
-================== Warning !!!!!! ==========================
-This BETA release of Bacula 2.5.x development code uses libtool
-to generate the Bacula libraries as shared objects rather than
-being directly linked in as in prior versions. This means that
-the Bacula shared objects, must either be in a shared object
-directory known to the loader or they must be in the directory
-that may be specified on the ./configure line using the
---libdir option as:
-
- ./configure --libdir=/full-path/dir
-
-the default /usr/lib. If --libdir is specified, there should be
-no need to modify your loader configuration provided that
-the shared objects are installed in that directory (Bacula
-does this with the make install command). The shared objects
-that Bacula references are:
-
-libbaccfg.so
-libbacfind.so
-libbacpy.so
-libbac.so
-
-If you have problems with libtool or you wish to use the old
-way of building static libraries, you can do so by disabling
-libtool on the configure command line with:
-
- ./configure --disable-libtool
-==============================================================
-
-
General:
+24Oct08
+kes Fix editing of retention time difference to use 64 bit
+ int instead of 64 bit unsigned. This should permit very
+ long retention periods.
+kes Implement code to prohibit a write job from appending to a
+ Volume that will be used for a read operation. This is
+ new code and could possibly cause some conflicts.
23Oct08
kes Integrate James Harper's Exchange Win32 plugin patch.
kes Apply patch from Marco van Wieringen that implements the new