[ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd $1 $2
[ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd $1 $2
[ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir $1 $2
- echo
- sleep 6
;;
restart)
const char *uar_sel_files =
"SELECT Path.Path,Filename.Name,FileIndex,JobId,LStat "
"FROM File,Filename,Path "
- "WHERE File.JobId=%s AND Filename.FilenameId=File.FilenameId "
+ "WHERE File.JobId IN (%s) AND Filename.FilenameId=File.FilenameId "
"AND Path.PathId=File.PathId";
const char *uar_del_temp = "DROP TABLE temp";
db_unlock(mdb);
return false;
}
-
- POOL_MEM buf (PM_MESSAGE);
-
+ POOL_MEM buf(PM_MESSAGE);
+
+#define new_db_get_file_list
+#ifdef new_db_get_file_list
+ /* This is broken, at least if called from ua_restore.c */
Mmsg(buf,
"SELECT Path.Path, Filename.Name, File.FileIndex, File.JobId, File.LStat "
"FROM ( "
"JOIN File ON (File.FileId = Temp.FileId) "
"WHERE File.FileIndex > 0 ",
jobids);
+#else
+ /*
+ * I am not sure that this works the same as the code in ua_restore.c
+ * but it is very similar.
+ */
+ Mmsg(buf, uar_sel_files, jobids);
+#endif
return db_sql_query(mdb, buf.c_str(), result_handler, ctx);
}
-
/* Full : do nothing
* Differential : get the last full id
* Incremental : get the last full + last diff + last incr(s) ids
ua->info_msg(_("\nBuilding directory tree for JobId(s) %s ... "),
rx->JobIds);
+#define new_get_file_list
+#ifdef new_get_file_list
if (!db_get_file_list(ua->jcr, ua->db, rx->JobIds, insert_tree_handler, (void *)&tree)) {
ua->error_msg("%s", db_strerror(ua->db));
}
+#else
+ for (p=rx->JobIds; get_next_jobid_from_list(&p, &JobId) > 0; ) {
+ char ed1[50];
+
+ if (JobId == last_JobId) {
+ continue; /* eliminate duplicate JobIds */
+ }
+ last_JobId = JobId;
+ /*
+ * Find files for this JobId and insert them in the tree
+ */
+ Mmsg(rx->query, uar_sel_files, edit_int64(JobId, ed1));
+ if (!db_sql_query(ua->db, rx->query, insert_tree_handler, (void *)&tree)) {
+ ua->error_msg("%s", db_strerror(ua->db));
+ }
+ }
+#endif
if (tree.FileCount == 0) {
ua->send_msg(_("\nThere were no files inserted into the tree, so file selection\n"
"is not possible.Most likely your retention policy pruned the files\n"));
int FileIndex;
JobId_t JobId;
-// Dmsg4(000, "Path=%s%s FI=%s JobId=%s\n", row[0], row[1],
-// row[2], row[3]);
+ Dmsg4(400, "Path=%s%s FI=%s JobId=%s\n", row[0], row[1],
+ row[2], row[3]);
if (*row[1] == 0) { /* no filename => directory */
if (!IsPathSeparator(*row[0])) { /* Must be Win32 directory */
type = TN_DIR_NLS;
#endif /* HAVE_CHFLAGS */
Qmsg3(jcr, M_ERROR, 0, _("Could not hard link %s -> %s: ERR=%s\n"),
attr->ofname, attr->olname, be.bstrerror());
+ Dmsg3(200, "Could not hard link %s -> %s: ERR=%s\n",
+ attr->ofname, attr->olname, be.bstrerror());
return CF_ERROR;
#ifdef HAVE_CHFLAGS
}
struct f_link *next;
dev_t dev; /* device */
ino_t ino; /* inode with device is unique */
- short linkcount;
uint32_t FileIndex; /* Bacula FileIndex of this file */
char name[1]; /* The name */
};
lp->dev == (dev_t)ff_pkt->statp.st_dev) {
/* If we have already backed up the hard linked file don't do it again */
if (strcmp(lp->name, fname) == 0) {
+ Dmsg2(400, "== Name identical skip FI=%d file=%s\n", lp->FileIndex, fname);
return 1; /* ignore */
}
ff_pkt->link = lp->name;
ff_pkt->type = FT_LNKSAVED; /* Handle link, file already saved */
ff_pkt->LinkFI = lp->FileIndex;
- return handle_file(jcr, ff_pkt, top_level);
+ ff_pkt->linked = 0;
+ rtn_stat = handle_file(jcr, ff_pkt, top_level);
+ Dmsg3(400, "FT_LNKSAVED FI=%d LinkFI=%d file=%s\n",
+ ff_pkt->FileIndex, lp->FileIndex, lp->name);
+ return rtn_stat;
}
/* File not previously dumped. Chain it into our list. */
lp = (struct f_link *)bmalloc(sizeof(struct f_link) + len);
lp->ino = ff_pkt->statp.st_ino;
lp->dev = ff_pkt->statp.st_dev;
+ lp->FileIndex = 0; /* set later */
bstrncpy(lp->name, fname, len);
lp->next = ff_pkt->linkhash[linkhash];
ff_pkt->linkhash[linkhash] = lp;
ff_pkt->linked = lp; /* mark saved link */
+ Dmsg2(400, "added to hash FI=%d file=%s\n", ff_pkt->FileIndex, lp->name);
} else {
ff_pkt->linked = NULL;
}
if (ff_pkt->linked) {
ff_pkt->linked->FileIndex = ff_pkt->FileIndex;
}
+ Dmsg3(400, "FT_REG FI=%d linked=%d file=%s\n", ff_pkt->FileIndex,
+ ff_pkt->linked ? 1 : 0, fname);
if (ff_pkt->flags & FO_KEEPATIME) {
utime(fname, &restore_times);
}
*/
attr->stream = stream;
Dmsg1(400, "Attr: %s\n", rec);
- if (sscanf(rec, "%ld %ld", &attr->file_index, &attr->type) != 2) {
+ if (sscanf(rec, "%d %d", &attr->file_index, &attr->type) != 2) {
Jmsg(jcr, M_FATAL, 0, _("Error scanning attributes: %s\n"), rec);
Dmsg1(100, "\nError scanning attributes. %s\n", rec);
return 0;
if (attr->type == FT_DELETED) { /* TODO: change this to get last seen values */
bsnprintf(buf, sizeof(buf),
- "---------- - - - - ---------- -------- %s\n", attr->ofname);
+ "---------- - - - - ---------- -------- %s\n", attr->ofname);
Dmsg1(20, "%s", buf);
Jmsg(jcr, M_RESTORED, 1, "%s", buf);
return;
#undef VERSION
#define VERSION "2.5.1"
-#define BDATE "04 July 2008"
-#define LSMDATE "04Jul08"
+#define BDATE "06 July 2008"
+#define LSMDATE "06Jul08"
#define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
#define BYEAR "2008" /* year for copyright messages in progs */
General:
+06Jul08
+kes Remove sleep at end of ./bacula
+kes Clear hash packet for hardlinked files correctly. This corrects
+ a long standing bug where hardlinked files selected individually
+ would occasionally not be restored.
05Jul08
kes Apply Eric's patch to ensure that autoprune does not return
a Volume not in the autochanger unless requested to do so.
clear_unload() only after drive is defined in acquire_for_read().
27Jun08
kes Generally clean up the manual tape loading code. The main
- conceptial change is that when a volume is marked to be unloaded,
+ conceptual change is that when a volume is marked to be unloaded,
its volume name is retained, and it is only marked as unloaded
when either the autoloader says it is unloaded or another tape
is read on that drive.
kes Fix regress to handle db_password.
ebl Add new "status storage slots" that list autochanger
content.
-ebl Update vtape driver to compile only under linux.
+ebl Update vtape driver to compile only under Linux.
ebl Fix a bug when restoring with a wrong mediatype.
18Jun08
kes Eliminate ints from conf files and structures to avoid
work with StorageId to be able to use a particular drive in a
autochanger.
09Jun08
-ebl Rename faketape to vtape.
-ebl Update faketape driver.
+ebl Rename vtape to vtape.
+ebl Update vtape driver.
08Jun08
-ebl Modify faketape driver to avoid sparse file.
+ebl Modify vtape driver to avoid sparse file.
kes Add make clean of qt-source directory during ./configure
kes Store last block number written to tape in DEVICE and
use it for testing for correct last block on EOT.
10May08
kes Add debug times, reduce size of two-pool-changer test
08May08
-ebl Tweak autoconf scripts for faketape
+ebl Tweak autoconf scripts for vtape
07May08
kes Improve SD reserve debug code.
kes Testing an improvement to free up volumes no longer in use.
16Mar08
ebl Reduce memory usage for accurate backup, working only with ctime
and mtime. (not all Lstat field)
- About 40MB for my linux system (400.000 files)
+ About 40MB for my Linux system (400.000 files)
14Mar08
kes Add dcr->reserved_volume flag that allows us to release a volume
even if it is not vol->released. This allows maxvol2 to work when