On Tue, Jun 07, 2011 at 12:40:18PM +0200, Roy Sigurd Karlsbakk wrote: > As far as I can understand, if a job is interrupted or failed, the data > stored on tape/disk won't be freed until the normal retention is over. Would > it be possible to add a flag for 'failed' data for quicker (or immediate) > retention?
I have a patch that might help you. Index: src/cats/sql_cmds.c =================================================================== RCS file: /home/graham/bacula-5.0.3/src/cats/sql_cmds.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- src/cats/sql_cmds.c +++ src/cats/sql_cmds.c @@ -95,10 +95,13 @@ const char *del_JobMedia = "DELETE FROM JobMedia WHERE JobId=%s"; const char *cnt_JobMedia = "SELECT count(*) FROM JobMedia WHERE MediaId=%s"; +/* Graham says: This was hacked so that it also selects jobs + in error, as well as those past the retention time. As of 2009-08-25, it + is only used in one place - ua_prune.c */ const char *sel_JobMedia = "SELECT DISTINCT JobMedia.JobId FROM JobMedia,Job " "WHERE MediaId=%s AND Job.JobId=JobMedia.JobId " - "AND Job.JobTDate<%s"; + "AND (Job.JobTDate<%s OR Job.JobStatus IN ('A','E','f'))"; /* Count Select JobIds for File deletion */ const char *count_select_job = ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users