6 #define DEFAULT_SORT_ORDER "hkdlpbfw"
8 typedef struct find_result_s {
9 struct find_result_s *next;
10 char *timestamp; /* dump timestamp */
11 char *write_timestamp;
15 char *label; /* holding filename for holding files */
17 char *status; /* status of the part */
18 char *dump_status; /* status of the dump; should be identical for all parts in dump */
19 char *message; /* reason for dump_status; should be identical for all parts in dump */
20 int partnum; /* -1 for holding files */
21 int totalparts; /* -1 for holding files */
22 double sec; /* may be 0.0 for older log files or holding files */
23 off_t kb; /* may be 0 for older log files, can be compressed */
24 off_t orig_kb; /* native size */
28 /* Finds /all/ dumps still on a volume. If diskqp is not NULL, then dumps
29 * not matching any existing disklist entry will be added to diskqp and to
30 * the global disklist. If diskqp is NULL, disks not matching existing
31 * disklist entries will be skipped. See search_logfile below, which does
32 * the dirty work for find_dump. */
33 find_result_t *find_dump(disklist_t* diskqp);
35 /* Return a list of unqualified filenames of logfiles for active
36 * tapes. Filenames are relative to the logdir.
38 * @returns: dynamically allocated, null-terminated strv
40 char **find_log(void);
42 void sort_find_result(char *sort_order, find_result_t **output_find);
43 void print_find_result(find_result_t *output_find);
44 void free_find_result(find_result_t **output_find);
45 find_result_t *dump_exist(find_result_t *output_find, char *hostname,
46 char *diskname, char *datestamp, int level);
47 find_result_t *dumps_match(find_result_t *output_find, char *hostname,
48 char *diskname, char *datestamp, char *level,
50 find_result_t *dumps_match_dumpspecs(find_result_t *output_find,
54 /* This function looks in a particular log.xxx file for dumps. Returns TRUE
55 * if something was found. This function also skips dumps whose disklist
56 * entries are not marked 'todo'.
57 * * output_find : Put found dumps here.
58 * * volume_label : If not NULL, restrict the search to
59 * dumps matching the given volume details.
60 * * log_datestamp : If not NULL, checks that this logfile is from this time.
61 * * logfile : Name of logfile in config dir.
62 * * dynamic_disklist : If not NULL, adds disks not already in the global
63 * disklist to the given disklist (and the global one).
64 * If dynamic_disklist is NULL, skips disks not in the
67 gboolean search_logfile(find_result_t **output_find, const char *volume_label,
68 const char *log_datestamp, const char *logfile,
69 disklist_t * dynamic_disklist);
71 /* return all dumps on holding disk; not really a search at all.
73 * * output_find : Put found dumps here.
74 * * dynamic_disklist : If not NULL, adds disks not already in the global
75 * disklist to the given disklist (and the global one).
76 * If dynamic_disklist is NULL, skips disks not in the
79 void search_holding_disk(
80 find_result_t **output_find,
81 disklist_t * dynamic_disklist);