- Default duration with no qualifier is sec should be 1 day
- Getting the following on all directories on Win32
19-May-2003 01:14 tibs-fd: Could not access c:/cygwin/home/kern/rxvt: ERR=Permission denied
-- Make sure Bacula prunes/purges canceled and failed jobs too!
- Find a solution for the multiple FileSet problem (when it is changed).
Add date?
- Cancel waiting for Client connect in SD if FD goes away.
-- Testing Tibs job erred and hung director on Storage resource.
+- Testing Tibs job erred and hung director on Storage resource. This was
+ because there were a whole pile of jobs hanging around in the SD
+ waiting for a connection from the FD that was never coming.
- Make restore more robust in counting error and not immediately bailing
out. Also print error message once, but try to continue.
- Make SD keep track of Files, Bytes during restore.
- Make default duration days if no qualifier (e.g. s) is specified.
- BSDI fix finding gcc version
- When the FD errs (e.g. disk full) have a more graceful shutdown.
-
+- Make sure Bacula prunes/purges canceled and failed jobs too and all
+ jobs with zero JobFiles.
* more recent backup -- i.e. are not the only backup.
* This is the list of Jobs to delete for a Backup Job.
*/
-#ifdef xxx
char *select_backup_del =
"SELECT DelCandidates.JobId "
"FROM Job,DelCandidates "
"WHERE (DelCandidates.JobFiles=0) OR "
- "(NOT DelCandidates.JobStatus='T') OR "
+ "(DelCandidates.JobStatus!='T') OR "
"(Job.JobTDate>%s "
"AND Job.ClientId=%u "
"AND Job.Type='B' "
"AND Job.Level='F' "
"AND Job.JobStatus='T' "
- "AND Job.FileSetId=DelCandidates.FileSetId)";
-#else
-char *select_backup_del =
- "SELECT DelCandidates.JobId "
- "FROM Job,DelCandidates "
- "WHERE (Job.JobTDate>%s "
- "AND Job.ClientId=%u "
- "AND Job.Type='B' "
- "AND Job.Level='F' "
- "AND Job.JobStatus='T' "
- "AND Job.FileSetId=DelCandidates.FileSetId)";
-#endif
+ "AND Job.FileSetId=DelCandidates.FileSetId) "
+ "GROUP BY JobId";
/* Select Jobs from the DelCandidates table that have a
* more recent InitCatalog -- i.e. are not the only InitCatalog
"AND Job.Type='V' "
"AND Job.Level='V' "
"AND Job.JobStatus='T' "
- "AND Job.FileSetId=DelCandidates.FileSetId";
+ "AND Job.FileSetId=DelCandidates.FileSetId "
+ "GROUP BY JobId";
/* Select Jobs from the DelCandidates table.
"FROM Job,DelCandidates "
"WHERE Job.JobTDate>%s "
"AND Job.ClientId=%u "
- "AND Job.Type='R'";
+ "AND Job.Type='R' "
+ "GROUP BY JobId";
db_lock(ua->db);
memset(&cr, 0, sizeof(cr));
memset(&del, 0, sizeof(del));
- strcpy(cr.Name, client->hdr.name);
+ bstrncpy(cr.Name, client->hdr.name, sizeof(cr.Name));
if (!db_create_client_record(ua->jcr, ua->db, &cr)) {
db_unlock(ua->db);
return 0;
db_lock(ua->db);
memset(&cr, 0, sizeof(cr));
memset(&del, 0, sizeof(del));
- strcpy(cr.Name, client->hdr.name);
+ bstrncpy(cr.Name, client->hdr.name, sizeof(cr.Name));
if (!db_create_client_record(ua->jcr, ua->db, &cr)) {
db_unlock(ua->db);
return 0;
}
/* Count Files to be deleted */
- strcpy(query, cnt_DelCand);
+ pm_strcpy(&query, cnt_DelCand);
Dmsg1(100, "select sql=%s\n", query);
cnt.count = 0;
if (!db_sql_query(ua->db, query, count_handler, (void *)&cnt)) {
* Then delete the Job entry, and finally and JobMedia records.
*/
for (i=0; i < del.num_ids; i++) {
- Dmsg1(100, "Delete JobId=%d\n", del.JobId[i]);
-#define xxx
-#ifdef xxx
+ Dmsg1(050, "Delete JobId=%d\n", del.JobId[i]);
if (!del.PurgedFiles[i]) {
Mmsg(&query, del_File, del.JobId[i]);
if (!db_sql_query(ua->db, query, NULL, (void *)NULL)) {
bsendmsg(ua, "%s", db_strerror(ua->db));
}
Dmsg1(050, "Del sql=%s\n", query);
-#endif
}
bsendmsg(ua, _("Pruned %d %s for client %s from catalog.\n"), del.num_ids,
del.num_ids==1?_("Job"):_("Jobs"), client->hdr.name);
}
return 1;
case 2: /* client */
- client = select_client_resource(ua);
- purge_files_from_client(ua, client);
+ client = get_client_resource(ua);
+ if (client) {
+ purge_files_from_client(ua, client);
+ }
return 1;
case 3: /* Volume */
if (select_media_dbr(ua, &mr)) {
case 1:
switch(find_arg_keyword(ua, jobs_keywords)) {
case 0: /* client */
- client = select_client_resource(ua);
- purge_jobs_from_client(ua, client);
+ client = get_client_resource(ua);
+ if (client) {
+ purge_jobs_from_client(ua, client);
+ }
return 1;
case 1: /* Volume */
if (select_media_dbr(ua, &mr)) {
}
switch (do_keyword_prompt(ua, _("Choose item to purge"), keywords)) {
case 0: /* files */
- client = select_client_resource(ua);
- if (!client) {
- return 1;
+ client = get_client_resource(ua);
+ if (client) {
+ purge_files_from_client(ua, client);
}
- purge_files_from_client(ua, client);
break;
case 1: /* jobs */
- client = select_client_resource(ua);
- if (!client) {
- return 1;
+ client = get_client_resource(ua);
+ if (client) {
+ purge_jobs_from_client(ua, client);
}
- purge_jobs_from_client(ua, client);
break;
case 2: /* Volume */
if (select_media_dbr(ua, &mr)) {
memset(&cr, 0, sizeof(cr));
memset(&del, 0, sizeof(del));
- strcpy(cr.Name, client->hdr.name);
+ bstrncpy(cr.Name, client->hdr.name, sizeof(cr.Name));
if (!db_create_client_record(ua->jcr, ua->db, &cr)) {
return 0;
}
/* */
#define VERSION "1.31"
#define VSTRING "1"
-#define BDATE "18 May 2003"
-#define LSMDATE "18May03"
+#define BDATE "19 May 2003"
+#define LSMDATE "19May03"
/* Debug flags */
#define DEBUG 1