- o Utiliser une alist dans les runscripts
+ - TODO:
+ * Backup a file that is not in accurate list (change NOCHG to LINK, FILE, etc..)
+ * Manage JobFiles (Deleted compte pour 1 ?)
+ * Gerer la fuite memoire...
+ PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
+12521 eric 15 0 178m 132m 844 S 0.0 26.4 2:39.30 bacula-fd
+
+
+ CREATE TEMPORARY TABLE btemp2 AS (
+ SELECT max(FileId) as FileId, PathId, FilenameId
+ FROM (SELECT FileId, PathId, FilenameId FROM File WHERE JobId IN (39867,40341)) AS F
+ GROUP BY PathId, FilenameId )
+
+ SELECT Path.Path, Filename.Name, File.FileIndex, File.JobId, File.LStat
+ FROM (
+ SELECT max(FileId) as FileId, PathId, FilenameId
+ FROM (SELECT FileId, PathId, FilenameId FROM File WHERE JobId IN (39867,40341)) AS F
+ GROUP BY PathId, FilenameId
+ ) AS Temp
+ JOIN Filename ON (Filename.FilenameId = Temp.FilenameId)
+ JOIN Path ON (Path.PathId = Temp.PathId)
+ JOIN File ON (File.FileId = Temp.FileId)
+ WHERE FileIndex > 0
+
+
+ SELECT File.FileIndex, Path.Path, Filename.Name, File.LStat
+ FROM btemp2 JOIN Path USING (PathId) JOIN Filename USING (FilenameId)
+ JOIN File USING (FileId)
+ WHERE File.FileIndex > 0
+
+ DROP TABLE btemp2
+*/
+/*
+SELECT DISTINCT ON (PathId, FilenameId) FileIndex, Path, Name, LStat
+ FROM File JOIN Filename USING (FilenameId) JOIN Path USING (PathId) WHERE JobId IN (40341)
+ ORDER BY PathId, FilenameId, JobId DESC
+*/
+
+
+
+
+ p Utiliser une alist dans les runscripts
RunScript {
console = "xxxx"
===================================================================
--- src/dird/backup.c (révision 6443)
+++ src/dird/backup.c (copie de travail)
-@@ -96,6 +96,138 @@
+@@ -96,6 +96,140 @@
return true;
}
+ free_pool_memory(nb);
+
+ jcr->file_bsock->signal(BNET_EOD);
++ /* TODO: use response() ? */
++
+ return true;
+}
+
/*
* Do a backup of the specified FileSet
*
-@@ -225,6 +357,14 @@
+@@ -225,6 +359,14 @@
Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db));
}
/* Send backup command */
fd->fsend(backupcmd);
if (!response(jcr, fd, OKbackup, "backup", DISPLAY_ERROR)) {
-@@ -234,6 +374,7 @@
+@@ -234,6 +376,7 @@
/* Pickup Job termination data */
stat = wait_for_job_termination(jcr);
db_write_batch_file_records(jcr); /* used by bulk batch file insert */
/* Forward referenced functions */
int save_file(JCR *jcr, FF_PKT *ff_pkt, bool top_level);
-@@ -48,8 +49,223 @@
+@@ -48,8 +49,225 @@
static bool crypto_session_start(JCR *jcr);
static void crypto_session_end(JCR *jcr);
static bool crypto_session_send(JCR *jcr, BSOCK *sd);
+ dir->fsend(_("2991 Bad accurate command\n"));
+ return false;
+ }
++
++ Jmsg(jcr, M_INFO, 0, _("Getting Accurate informations.\n"));
+
+ jcr->file_list = (htable *)malloc(sizeof(htable));
+ jcr->file_list->init(elt, &elt->link, nb);
+ Dmsg2(1, "add fname=%s lstat=%s\n", elt->fname, elt->lstat);
+ }
+ }
-+
++
+// jcr->file_list->stats();
+ /* TODO: send a EOM ?
+ dir->fsend("2000 OK accurate\n");
* Find all the requested files and send them
* to the Storage daemon.
*
-@@ -66,7 +282,6 @@
+@@ -66,7 +284,6 @@
BSOCK *sd;
bool ok = true;
// TODO landonf: Allow user to specify encryption algorithm
sd = jcr->store_bsock;
set_jcr_job_status(jcr, JS_Running);
-@@ -100,7 +315,7 @@
+@@ -100,7 +317,7 @@
*/
jcr->compress_buf_size = jcr->buf_size + ((jcr->buf_size+999) / 1000) + 30;
jcr->compress_buf = get_memory(jcr->compress_buf_size);
#ifdef HAVE_LIBZ
z_stream *pZlibStream = (z_stream*)malloc(sizeof(z_stream));
if (pZlibStream) {
-@@ -134,7 +349,10 @@
+@@ -134,7 +351,10 @@
ok = false; /* error */
set_jcr_job_status(jcr, JS_ErrorTerminated);
}
free_pool_memory(jcr->acl_text);
stop_heartbeat_monitor(jcr);
-@@ -354,9 +572,21 @@
+@@ -354,9 +574,21 @@
}
case FT_DIRNOCHG:
case FT_NOCHG:
Jmsg(jcr, M_NOTSAVED, 0, _(" Archive file not saved: %s\n"), ff_pkt->fname);
return 1;
case FT_NOOPEN: {
-@@ -1118,6 +1348,9 @@
+@@ -1118,6 +1350,9 @@
}
unstrip_path(ff_pkt);
Dmsg2(300, ">stored: attr len=%d: %s\n", sd->msglen, sd->msg);
if (!stat) {
Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"),
-@@ -1128,6 +1361,58 @@
+@@ -1128,6 +1363,58 @@
return true;
}