[1] | 1 | /***************************************************************************
|
---|
[2211] | 2 | $Id: libmondo-verify.c 2230 2009-06-17 20:53:23Z bruno $
|
---|
[1] | 3 | ***************************************************************************/
|
---|
| 4 |
|
---|
| 5 |
|
---|
| 6 | /**
|
---|
| 7 | * @file
|
---|
| 8 | * Functions for verifying backups (booted from hard drive, not CD).
|
---|
| 9 | */
|
---|
| 10 |
|
---|
| 11 | #include "my-stuff.h"
|
---|
[2211] | 12 | #include "mr_mem.h"
|
---|
[1] | 13 | #include "mondostructures.h"
|
---|
| 14 | #include "libmondo-verify.h"
|
---|
[541] | 15 | #include "libmondo-gui-EXT.h"
|
---|
[1] | 16 | #include "libmondo-files-EXT.h"
|
---|
| 17 | #include "libmondo-fork-EXT.h"
|
---|
| 18 | #include "libmondo-stream-EXT.h"
|
---|
| 19 | #include "libmondo-string-EXT.h"
|
---|
| 20 | #include "libmondo-devices-EXT.h"
|
---|
| 21 | #include "libmondo-tools-EXT.h"
|
---|
[541] | 22 | #include "lib-common-externs.h"
|
---|
[1] | 23 |
|
---|
| 24 | /*@unused@*/
|
---|
[117] | 25 | //static char cvsid[] = "$Id: libmondo-verify.c 2230 2009-06-17 20:53:23Z bruno $";
|
---|
[1] | 26 |
|
---|
| 27 | /**
|
---|
| 28 | * The number of the most recently verified afioball.
|
---|
| 29 | * @ingroup globalGroup
|
---|
| 30 | */
|
---|
| 31 | int g_last_afioball_number = -1;
|
---|
| 32 |
|
---|
[948] | 33 | extern char *g_getfacl;
|
---|
| 34 | extern char *g_getfattr;
|
---|
[1316] | 35 | extern char *MONDO_LOGFILE;
|
---|
[1] | 36 |
|
---|
[1645] | 37 | /* Reference to global bkpinfo */
|
---|
| 38 | extern struct s_bkpinfo *bkpinfo;
|
---|
| 39 |
|
---|
[1648] | 40 |
|
---|
[1] | 41 | /**
|
---|
[1648] | 42 | * Generate the filename of a tarball to verify.
|
---|
| 43 | * @param bkpinfo The backup information structure. @c bkpinfo->zip_suffix is the only field used.
|
---|
| 44 | * @param mountpoint The directory where the CD/DVD/ISO is mounted.
|
---|
| 45 | * @param setno The afioball number to get the location of.
|
---|
| 46 | * @return The absolute path to the afioball.
|
---|
| 47 | * @note The returned string points to static data that will be overwritten with each call.
|
---|
| 48 | * @ingroup stringGroup
|
---|
| 49 | */
|
---|
| 50 | char *vfy_tball_fname(char *mountpoint, int setno)
|
---|
| 51 | {
|
---|
| 52 | /*@ buffers ******************************************************* */
|
---|
| 53 | static char output[MAX_STR_LEN];
|
---|
| 54 |
|
---|
| 55 | assert(bkpinfo != NULL);
|
---|
| 56 | assert_string_is_neither_NULL_nor_zerolength(mountpoint);
|
---|
| 57 | sprintf(output, "%s/archives/%d.star.%s", mountpoint, setno,
|
---|
| 58 | bkpinfo->zip_suffix);
|
---|
| 59 | if (!does_file_exist(output)) {
|
---|
| 60 | sprintf(output, "%s/archives/%d.afio.%s", mountpoint, setno,
|
---|
| 61 | bkpinfo->zip_suffix);
|
---|
| 62 | }
|
---|
| 63 | return (output);
|
---|
| 64 | }
|
---|
| 65 |
|
---|
| 66 |
|
---|
| 67 | /**
|
---|
[1] | 68 | * Generate a list of the files that have changed, based on @c afio @c -r
|
---|
| 69 | * messages.
|
---|
| 70 | * @param changedfiles_fname Filename of the place to put a list of afio's reported changed.
|
---|
| 71 | * @param ignorefiles_fname Filename of a list of files to ignore (use "" if none).
|
---|
| 72 | * @param stderr_fname File containing afio's stderr output.
|
---|
| 73 | * @return The number of differences found (0 for a perfect backup).
|
---|
| 74 | * @bug This function seems orphaned.
|
---|
| 75 | * @ingroup utilityGroup
|
---|
| 76 | */
|
---|
| 77 | long
|
---|
[128] | 78 | generate_list_of_changed_files(char *changedfiles_fname,
|
---|
| 79 | char *ignorefiles_fname, char *stderr_fname)
|
---|
[1] | 80 | {
|
---|
[128] | 81 | /*@ buffer ********************************************************** */
|
---|
| 82 | char *command;
|
---|
[1] | 83 | char *afio_found_changes;
|
---|
| 84 |
|
---|
[128] | 85 | /*@ int ************************************************************* */
|
---|
| 86 | int res = 0;
|
---|
[1] | 87 |
|
---|
[128] | 88 | /*@ long ************************************************************ */
|
---|
| 89 | long afio_diffs = 0;
|
---|
[1] | 90 |
|
---|
[128] | 91 | command = malloc(2000);
|
---|
| 92 | afio_found_changes = malloc(500);
|
---|
| 93 | assert_string_is_neither_NULL_nor_zerolength(changedfiles_fname);
|
---|
| 94 | assert_string_is_neither_NULL_nor_zerolength(ignorefiles_fname);
|
---|
| 95 | assert_string_is_neither_NULL_nor_zerolength(stderr_fname);
|
---|
[1] | 96 |
|
---|
[128] | 97 | sprintf(afio_found_changes, "%s.afio", ignorefiles_fname);
|
---|
| 98 | paranoid_system("sync");
|
---|
| 99 |
|
---|
[1] | 100 | /* sprintf (command,
|
---|
[273] | 101 | "grep \"afio: \" %s | awk '{j=substr($0,8); i=index(j,\": \");printf \"/%%s\\n\",substr(j,1,i-2);}' | sort -u | grep -v \"incheckentry.*xwait\" | grep -vx \"/afio:.*\" | grep -vx \"/dev/.*\" > %s",
|
---|
[1] | 102 | stderr_fname, afio_found_changes);
|
---|
| 103 | */
|
---|
| 104 |
|
---|
[128] | 105 | log_msg(1, "Now scanning log file for 'afio: ' stuff");
|
---|
| 106 | sprintf(command,
|
---|
[911] | 107 | "grep \"afio: \" %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s",
|
---|
[128] | 108 | stderr_fname, afio_found_changes);
|
---|
| 109 | log_msg(2, command);
|
---|
| 110 | res = system(command);
|
---|
| 111 | if (res) {
|
---|
| 112 | log_msg(2, "Warning - failed to think");
|
---|
| 113 | }
|
---|
| 114 |
|
---|
| 115 | log_msg(1, "Now scanning log file for 'star: ' stuff");
|
---|
| 116 | sprintf(command,
|
---|
[911] | 117 | "grep \"star: \" %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s",
|
---|
[128] | 118 | stderr_fname, afio_found_changes);
|
---|
| 119 | log_msg(2, command);
|
---|
| 120 | res = system(command);
|
---|
| 121 | if (res) {
|
---|
| 122 | log_msg(2, "Warning - failed to think");
|
---|
| 123 | }
|
---|
[1] | 124 | // exclude_nonexistent_files (afio_found_changes);
|
---|
[128] | 125 | afio_diffs = count_lines_in_file(afio_found_changes);
|
---|
| 126 | sprintf(command,
|
---|
[273] | 127 | "sort %s %s %s | uniq -c | awk '{ if ($1==\"2\") {print $2;};}' | grep -v \"incheckentry xwait()\" > %s",
|
---|
[128] | 128 | ignorefiles_fname, afio_found_changes, afio_found_changes,
|
---|
| 129 | changedfiles_fname);
|
---|
| 130 | log_msg(2, command);
|
---|
| 131 | paranoid_system(command);
|
---|
| 132 | paranoid_free(command);
|
---|
| 133 | paranoid_free(afio_found_changes);
|
---|
| 134 | return (afio_diffs);
|
---|
[1] | 135 | }
|
---|
| 136 |
|
---|
| 137 |
|
---|
| 138 | /**
|
---|
| 139 | * @addtogroup LLverifyGroup
|
---|
| 140 | * @{
|
---|
| 141 | */
|
---|
| 142 | /**
|
---|
| 143 | * Verify all afioballs stored on the inserted CD (or an ISO image).
|
---|
| 144 | * @param bkpinfo The backup information structure. @c bkpinfo->backup_media_type
|
---|
| 145 | * is used in this function, and the structure is also passed to verify_an_afioball_from_CD().
|
---|
| 146 | * @param mountpoint The location the CD/DVD/ISO is mounted on.
|
---|
| 147 | * @return The number of sets containing differences (0 for success).
|
---|
| 148 | */
|
---|
[1645] | 149 | int verify_afioballs_on_CD(char *mountpoint)
|
---|
[1] | 150 | {
|
---|
| 151 |
|
---|
[128] | 152 | /*@ buffers ********************************************************* */
|
---|
| 153 | char *tmp;
|
---|
[1] | 154 |
|
---|
[128] | 155 | /*@ int ************************************************************* */
|
---|
| 156 | int set_number = 0;
|
---|
[1] | 157 | int retval = 0;
|
---|
| 158 | int total_sets = 0;
|
---|
| 159 | int percentage = 0;
|
---|
| 160 |
|
---|
[128] | 161 | assert_string_is_neither_NULL_nor_zerolength(mountpoint);
|
---|
| 162 | assert(bkpinfo != NULL);
|
---|
| 163 | malloc_string(tmp);
|
---|
| 164 |
|
---|
| 165 | for (set_number = 0;
|
---|
| 166 | set_number < 9999
|
---|
| 167 | &&
|
---|
[1645] | 168 | !does_file_exist(vfy_tball_fname(mountpoint, set_number));
|
---|
[128] | 169 | set_number++);
|
---|
[1645] | 170 | if (!does_file_exist(vfy_tball_fname(mountpoint, set_number))) {
|
---|
[128] | 171 | return (0);
|
---|
[1] | 172 | }
|
---|
[128] | 173 |
|
---|
| 174 | if (g_last_afioball_number != set_number - 1) {
|
---|
| 175 | if (set_number == 0) {
|
---|
| 176 | log_msg(1,
|
---|
| 177 | "Weird error in verify_afioballs_on_CD() but it's really a cosmetic error, nothing more");
|
---|
| 178 | } else {
|
---|
| 179 | retval++;
|
---|
| 180 | sprintf(tmp, "Warning - missing set(s) between %d and %d\n",
|
---|
| 181 | g_last_afioball_number, set_number - 1);
|
---|
| 182 | log_to_screen(tmp);
|
---|
| 183 | }
|
---|
| 184 | }
|
---|
| 185 | sprintf(tmp, "Verifying %s #%d's tarballs",
|
---|
| 186 | media_descriptor_string(bkpinfo->backup_media_type),
|
---|
| 187 | g_current_media_number);
|
---|
| 188 | open_evalcall_form(tmp);
|
---|
| 189 |
|
---|
| 190 | for (total_sets = set_number;
|
---|
[1645] | 191 | does_file_exist(vfy_tball_fname(mountpoint, total_sets));
|
---|
[128] | 192 | total_sets++) {
|
---|
| 193 | log_msg(1, "total_sets = %d", total_sets);
|
---|
| 194 | }
|
---|
| 195 | for (;
|
---|
[1645] | 196 | does_file_exist(vfy_tball_fname(mountpoint, set_number));
|
---|
[128] | 197 | set_number++) {
|
---|
| 198 | percentage =
|
---|
| 199 | (set_number - g_last_afioball_number) * 100 / (total_sets -
|
---|
| 200 | g_last_afioball_number);
|
---|
| 201 | update_evalcall_form(percentage);
|
---|
| 202 | log_msg(1, "set = %d", set_number);
|
---|
| 203 | retval +=
|
---|
[1645] | 204 | verify_an_afioball_from_CD(vfy_tball_fname(mountpoint, set_number));
|
---|
[128] | 205 | }
|
---|
| 206 | g_last_afioball_number = set_number - 1;
|
---|
| 207 | close_evalcall_form();
|
---|
| 208 | paranoid_free(tmp);
|
---|
| 209 | return (retval);
|
---|
[1] | 210 | }
|
---|
| 211 |
|
---|
| 212 | /**
|
---|
| 213 | * Verify all slices stored on the inserted CD (or a mounted ISO image).
|
---|
| 214 | * @param bkpinfo The backup information structure. Fields used:
|
---|
| 215 | * - @c compression_level
|
---|
| 216 | * - @c restore_path
|
---|
| 217 | * - @c use_lzo
|
---|
| 218 | * - @c zip_exe
|
---|
| 219 | * - @c zip_suffix
|
---|
| 220 | * @param mtpt The mountpoint the CD/DVD/ISO is mounted on.
|
---|
| 221 | * @return The number of differences (0 for perfect biggiefiles).
|
---|
| 222 | */
|
---|
[1645] | 223 | int verify_all_slices_on_CD(char *mtpt)
|
---|
[1] | 224 | {
|
---|
| 225 |
|
---|
[128] | 226 | /*@ buffer ********************************************************** */
|
---|
| 227 | char *tmp;
|
---|
| 228 | char *mountpoint;
|
---|
[1] | 229 | // char ca, cb;
|
---|
[128] | 230 | char *command;
|
---|
| 231 | char *sz_exe;
|
---|
| 232 | static char *bufblkA = NULL;
|
---|
| 233 | static char *bufblkB = NULL;
|
---|
| 234 | const long maxbufsize = 65536L;
|
---|
| 235 | long currsizA = 0;
|
---|
| 236 | long currsizB = 0;
|
---|
| 237 | long j;
|
---|
[1] | 238 |
|
---|
[128] | 239 | /*@ long ************************************************************ */
|
---|
| 240 | long bigfile_num = 0;
|
---|
| 241 | long slice_num = -1;
|
---|
| 242 | int res;
|
---|
[1] | 243 |
|
---|
[128] | 244 | static FILE *forig = NULL;
|
---|
| 245 | static struct s_filename_and_lstat_info biggiestruct;
|
---|
| 246 | static long last_bigfile_num = -1;
|
---|
| 247 | static long last_slice_num = -1;
|
---|
| 248 | FILE *pin;
|
---|
| 249 | FILE *fin;
|
---|
| 250 | int retval = 0;
|
---|
[1] | 251 | // long long outlen;
|
---|
| 252 |
|
---|
[128] | 253 | malloc_string(tmp);
|
---|
| 254 | malloc_string(mountpoint);
|
---|
| 255 | malloc_string(command);
|
---|
| 256 | malloc_string(sz_exe);
|
---|
| 257 | if (!bufblkA) {
|
---|
| 258 | if (!(bufblkA = malloc(maxbufsize))) {
|
---|
| 259 | fatal_error("Cannot malloc bufblkA");
|
---|
| 260 | }
|
---|
| 261 | }
|
---|
| 262 | if (!bufblkB) {
|
---|
| 263 | if (!(bufblkB = malloc(maxbufsize))) {
|
---|
| 264 | fatal_error("Cannot malloc bufblkB");
|
---|
| 265 | }
|
---|
| 266 | }
|
---|
[1] | 267 |
|
---|
[128] | 268 | assert(bkpinfo != NULL);
|
---|
| 269 | assert_string_is_neither_NULL_nor_zerolength(mtpt);
|
---|
[1] | 270 |
|
---|
[128] | 271 | if (bkpinfo->compression_level > 0) {
|
---|
| 272 | if (bkpinfo->use_lzo) {
|
---|
| 273 | strcpy(sz_exe, "lzop");
|
---|
[1003] | 274 | } else if (bkpinfo->use_gzip) {
|
---|
[998] | 275 | strcpy(sz_exe, "gzip");
|
---|
[128] | 276 | } else {
|
---|
| 277 | strcpy(sz_exe, "bzip2");
|
---|
| 278 | }
|
---|
| 279 | } else {
|
---|
| 280 | sz_exe[0] = '\0';
|
---|
| 281 | }
|
---|
[1] | 282 |
|
---|
[2230] | 283 | log_it("before vsbf");
|
---|
[128] | 284 | sprintf(tmp, "Verifying %s#%d's big files",
|
---|
| 285 | media_descriptor_string(bkpinfo->backup_media_type),
|
---|
| 286 | g_current_media_number);
|
---|
| 287 | open_evalcall_form(tmp);
|
---|
[2230] | 288 | log_it("after vsbf");
|
---|
[128] | 289 | sprintf(mountpoint, "%s/archives", mtpt);
|
---|
| 290 | if (last_bigfile_num == -1) {
|
---|
| 291 | bigfile_num = 0;
|
---|
| 292 | slice_num = 0;
|
---|
| 293 | } else if (slice_num == 0) {
|
---|
| 294 | bigfile_num = last_bigfile_num + 1;
|
---|
| 295 | slice_num = 0;
|
---|
| 296 | } else {
|
---|
| 297 | bigfile_num = last_bigfile_num;
|
---|
| 298 | slice_num = last_slice_num + 1;
|
---|
| 299 | }
|
---|
| 300 | while (does_file_exist
|
---|
| 301 | (slice_fname
|
---|
| 302 | (bigfile_num, slice_num, mountpoint, bkpinfo->zip_suffix))
|
---|
| 303 | ||
|
---|
| 304 | does_file_exist(slice_fname
|
---|
| 305 | (bigfile_num, slice_num, mountpoint, ""))) {
|
---|
[1236] | 306 | // handle slices until end of CD
|
---|
[128] | 307 | if (slice_num == 0) {
|
---|
| 308 | log_msg(2, "ISO=%d bigfile=%ld --START--",
|
---|
| 309 | g_current_media_number, bigfile_num);
|
---|
| 310 | if (!
|
---|
| 311 | (fin =
|
---|
| 312 | fopen(slice_fname(bigfile_num, slice_num, mountpoint, ""),
|
---|
| 313 | "r"))) {
|
---|
| 314 | log_msg(2, "Cannot open bigfile's info file");
|
---|
| 315 | } else {
|
---|
| 316 | if (fread
|
---|
| 317 | ((void *) &biggiestruct, 1, sizeof(biggiestruct),
|
---|
| 318 | fin) < sizeof(biggiestruct)) {
|
---|
| 319 | log_msg(2, "Unable to get biggiestruct");
|
---|
| 320 | }
|
---|
| 321 | paranoid_fclose(fin);
|
---|
| 322 | }
|
---|
| 323 | sprintf(tmp, "%s/%s", bkpinfo->restore_path,
|
---|
| 324 | biggiestruct.filename);
|
---|
| 325 | log_msg(2, "Opening biggiefile #%ld - '%s'", bigfile_num, tmp);
|
---|
| 326 | if (!(forig = fopen(tmp, "r"))) {
|
---|
| 327 | log_msg(2, "Failed to open bigfile. Darn.");
|
---|
[1262] | 328 | log_to_screen("%s/%s not found on live filesystem",
|
---|
[1236] | 329 | bkpinfo->restore_path,
|
---|
| 330 | biggiestruct.filename);
|
---|
[2211] | 331 | mr_asprintf(&tmp, "echo \"%s/%s not found\" >> %s/biggies.changed",
|
---|
[1236] | 332 | bkpinfo->restore_path,
|
---|
[1644] | 333 | biggiestruct.filename,
|
---|
| 334 | bkpinfo->tmpdir);
|
---|
[1236] | 335 | system(tmp);
|
---|
| 336 | paranoid_free(tmp);
|
---|
| 337 |
|
---|
| 338 | bigfile_num++;
|
---|
| 339 | slice_num = 0;
|
---|
[128] | 340 | retval++;
|
---|
[1236] | 341 | } else {
|
---|
| 342 | slice_num++;
|
---|
[128] | 343 | }
|
---|
[1236] | 344 | } else if (does_file_exist(slice_fname(bigfile_num, slice_num, mountpoint, "")) &&
|
---|
| 345 | (length_of_file(slice_fname(bigfile_num, slice_num, mountpoint, "")) == 0)) {
|
---|
[128] | 346 | log_msg(2, "ISO=%d bigfile=%ld ---END---",
|
---|
| 347 | g_current_media_number, bigfile_num);
|
---|
| 348 | bigfile_num++;
|
---|
| 349 | paranoid_fclose(forig);
|
---|
| 350 | slice_num = 0;
|
---|
| 351 | } else {
|
---|
[1261] | 352 | log_msg(2, "ISO=%d bigfile=%ld slice=%ld",
|
---|
[128] | 353 | g_current_media_number, bigfile_num, slice_num);
|
---|
[1236] | 354 | if (!does_file_exist(slice_fname(bigfile_num, slice_num, mountpoint, ""))) {
|
---|
[273] | 355 | sprintf(command, "%s -dc %s 2>> %s",
|
---|
| 356 | sz_exe,
|
---|
[1236] | 357 | slice_fname(bigfile_num, slice_num, mountpoint, bkpinfo->zip_suffix),
|
---|
[128] | 358 | MONDO_LOGFILE);
|
---|
| 359 | } else {
|
---|
[1236] | 360 | sprintf(command, "cat %s 2>> %s",
|
---|
| 361 | slice_fname(bigfile_num, slice_num, mountpoint, ""), MONDO_LOGFILE);
|
---|
[128] | 362 | }
|
---|
| 363 | if ((pin = popen(command, "r"))) {
|
---|
| 364 | res = 0;
|
---|
| 365 | while (!feof(pin)) {
|
---|
| 366 | currsizA = fread(bufblkA, 1, maxbufsize, pin);
|
---|
| 367 | if (currsizA <= 0) {
|
---|
| 368 | break;
|
---|
| 369 | }
|
---|
| 370 | currsizB = fread(bufblkB, 1, currsizA, forig);
|
---|
| 371 | if (currsizA != currsizB) {
|
---|
| 372 | res++;
|
---|
| 373 | } else {
|
---|
| 374 | for (j = 0;
|
---|
| 375 | j < currsizA && bufblkA[j] == bufblkB[j];
|
---|
| 376 | j++);
|
---|
| 377 | if (j < currsizA) {
|
---|
| 378 | res++;
|
---|
| 379 | }
|
---|
| 380 | }
|
---|
| 381 | }
|
---|
| 382 | paranoid_pclose(pin);
|
---|
[1236] | 383 | if (res && !strncmp(biggiestruct.filename, "/dev/", 5)) {
|
---|
[128] | 384 | log_msg(3,
|
---|
[296] | 385 | "Ignoring differences between %s and live filesystem because it's a device and therefore the archives are stored via ntfsclone, not dd.",
|
---|
[128] | 386 | biggiestruct.filename);
|
---|
| 387 | log_msg(3,
|
---|
| 388 | "If you really want verification for %s, please contact the devteam and offer an incentive.",
|
---|
| 389 | biggiestruct.filename);
|
---|
| 390 | res = 0;
|
---|
| 391 | }
|
---|
| 392 | if (res) {
|
---|
| 393 | log_msg(0,
|
---|
| 394 | "afio: \"%s\": Corrupt biggie file, says libmondo-archive.c",
|
---|
| 395 | biggiestruct.filename);
|
---|
| 396 | retval++;
|
---|
| 397 | }
|
---|
| 398 | }
|
---|
| 399 | slice_num++;
|
---|
| 400 | }
|
---|
[1] | 401 | }
|
---|
[128] | 402 | last_bigfile_num = bigfile_num;
|
---|
| 403 | last_slice_num = slice_num - 1;
|
---|
| 404 | if (last_slice_num < 0) {
|
---|
| 405 | last_bigfile_num--;
|
---|
[1] | 406 | }
|
---|
[128] | 407 | close_evalcall_form();
|
---|
| 408 | if (bufblkA) {
|
---|
| 409 | paranoid_free(bufblkA);
|
---|
[1] | 410 | }
|
---|
[128] | 411 | if (bufblkB) {
|
---|
| 412 | paranoid_free(bufblkB);
|
---|
| 413 | }
|
---|
| 414 | paranoid_free(tmp);
|
---|
| 415 | paranoid_free(command);
|
---|
| 416 | paranoid_free(sz_exe);
|
---|
| 417 | paranoid_free(mountpoint);
|
---|
| 418 | return (0);
|
---|
[1] | 419 | }
|
---|
| 420 |
|
---|
| 421 |
|
---|
| 422 |
|
---|
| 423 |
|
---|
| 424 |
|
---|
| 425 |
|
---|
| 426 | /**
|
---|
| 427 | * Verify one afioball from the CD.
|
---|
| 428 | * You should be changed to the root directory (/) for this to work.
|
---|
| 429 | * @param bkpinfo The backup information structure. Fields used:
|
---|
| 430 | * - @c bkpinfo->use_lzo
|
---|
| 431 | * - @c bkpinfo->tmpdir
|
---|
| 432 | * - @c bkpinfo->zip_exe
|
---|
| 433 | * - @c bkpinfo->zip_suffix
|
---|
| 434 | * @param tarball_fname The filename of the afioball to verify.
|
---|
| 435 | * @return 0, always.
|
---|
| 436 | */
|
---|
[1645] | 437 | int verify_a_tarball(char *tarball_fname)
|
---|
[1] | 438 | {
|
---|
[128] | 439 | /*@ buffers ********************************************************* */
|
---|
| 440 | char *command;
|
---|
[1] | 441 | char *outlog;
|
---|
| 442 | char *tmp;
|
---|
[128] | 443 | // char *p;
|
---|
[1] | 444 |
|
---|
[128] | 445 | /*@ pointers ******************************************************* */
|
---|
| 446 | FILE *pin;
|
---|
[1] | 447 |
|
---|
[128] | 448 | /*@ long *********************************************************** */
|
---|
| 449 | long diffs = 0;
|
---|
| 450 | /* getcwd(old_pwd,MAX_STR_LEN-1); */
|
---|
[1] | 451 |
|
---|
| 452 |
|
---|
[128] | 453 | command = malloc(2000);
|
---|
| 454 | malloc_string(outlog);
|
---|
| 455 | malloc_string(tmp);
|
---|
| 456 | assert(bkpinfo != NULL);
|
---|
| 457 | assert_string_is_neither_NULL_nor_zerolength(tarball_fname);
|
---|
[1] | 458 |
|
---|
[128] | 459 | log_it("Verifying fileset '%s'", tarball_fname);
|
---|
| 460 | /* chdir("/"); */
|
---|
| 461 | sprintf(outlog, "%s/afio.log", bkpinfo->tmpdir);
|
---|
[1] | 462 | /* if programmer forgot to say which compression thingy to use then find out */
|
---|
[128] | 463 | if (strstr(tarball_fname, ".lzo")
|
---|
| 464 | && strcmp(bkpinfo->zip_suffix, "lzo")) {
|
---|
| 465 | log_msg(2, "OK, I'm going to start using lzop.");
|
---|
| 466 | strcpy(bkpinfo->zip_exe, "lzop");
|
---|
| 467 | strcpy(bkpinfo->zip_suffix, "lzo");
|
---|
| 468 | bkpinfo->use_lzo = TRUE;
|
---|
[998] | 469 | bkpinfo->use_gzip = FALSE;
|
---|
[128] | 470 | }
|
---|
[998] | 471 | if (strstr(tarball_fname, ".gz")
|
---|
| 472 | && strcmp(bkpinfo->zip_suffix, "gz")) {
|
---|
| 473 | log_msg(2, "OK, I'm going to start using gzip.");
|
---|
| 474 | strcpy(bkpinfo->zip_exe, "gzip");
|
---|
| 475 | strcpy(bkpinfo->zip_suffix, "gz");
|
---|
| 476 | bkpinfo->use_lzo = FALSE;
|
---|
| 477 | bkpinfo->use_gzip = TRUE;
|
---|
| 478 | }
|
---|
[128] | 479 | if (strstr(tarball_fname, ".bz2")
|
---|
| 480 | && strcmp(bkpinfo->zip_suffix, "bz2")) {
|
---|
| 481 | log_msg(2, "OK, I'm going to start using bzip2.");
|
---|
| 482 | strcpy(bkpinfo->zip_exe, "bzip2");
|
---|
| 483 | strcpy(bkpinfo->zip_suffix, "bz2");
|
---|
| 484 | bkpinfo->use_lzo = FALSE;
|
---|
[998] | 485 | bkpinfo->use_gzip = FALSE;
|
---|
[128] | 486 | }
|
---|
| 487 | unlink(outlog);
|
---|
| 488 | if (strstr(tarball_fname, ".star")) {
|
---|
| 489 | bkpinfo->use_star = TRUE;
|
---|
| 490 | if (strstr(tarball_fname, ".bz2"))
|
---|
| 491 | sprintf(command,
|
---|
| 492 | "star -diff diffopts=mode,size,data file=%s %s >> %s 2>> %s",
|
---|
| 493 | tarball_fname,
|
---|
| 494 | (strstr(tarball_fname, ".bz2")) ? "-bz" : " ", outlog,
|
---|
| 495 | outlog);
|
---|
| 496 | } else {
|
---|
| 497 | bkpinfo->use_star = FALSE;
|
---|
| 498 | sprintf(command, "afio -r -P %s -Z %s >> %s 2>> %s",
|
---|
| 499 | bkpinfo->zip_exe, tarball_fname, outlog, outlog);
|
---|
| 500 | }
|
---|
| 501 | log_msg(6, "command=%s", command);
|
---|
| 502 | paranoid_system(command);
|
---|
| 503 | if (length_of_file(outlog) < 10) {
|
---|
| 504 | sprintf(command, "cat %s >> %s", outlog, MONDO_LOGFILE);
|
---|
| 505 | } else {
|
---|
[273] | 506 | sprintf(command, "cut -d: -f%d %s | sort -u",
|
---|
| 507 | (bkpinfo->use_star) ? 1 : 2, outlog);
|
---|
[128] | 508 | pin = popen(command, "r");
|
---|
| 509 | if (pin) {
|
---|
| 510 | for (fgets(tmp, MAX_STR_LEN, pin); !feof(pin);
|
---|
| 511 | fgets(tmp, MAX_STR_LEN, pin)) {
|
---|
| 512 | if (bkpinfo->use_star) {
|
---|
| 513 | if (!strstr(tmp, "diffopts=")) {
|
---|
| 514 | while (strlen(tmp) > 0
|
---|
| 515 | && tmp[strlen(tmp) - 1] < 32) {
|
---|
| 516 | tmp[strlen(tmp) - 1] = '\0';
|
---|
| 517 | }
|
---|
| 518 | if (strchr(tmp, '/')) {
|
---|
| 519 | if (!diffs) {
|
---|
| 520 | log_msg(0, "'%s' - differences found",
|
---|
| 521 | tarball_fname);
|
---|
| 522 | }
|
---|
| 523 | log_msg(0, "star: /%s",
|
---|
| 524 | strip_afio_output_line(tmp));
|
---|
| 525 | diffs++;
|
---|
| 526 | }
|
---|
| 527 | }
|
---|
| 528 | } else {
|
---|
| 529 | if (!diffs) {
|
---|
| 530 | log_msg(0, "'%s' - differences found",
|
---|
| 531 | tarball_fname);
|
---|
| 532 | }
|
---|
| 533 | log_msg(0, "afio: /%s", strip_afio_output_line(tmp));
|
---|
| 534 | diffs++;
|
---|
| 535 | }
|
---|
[1] | 536 | }
|
---|
[128] | 537 | paranoid_pclose(pin);
|
---|
| 538 | } else {
|
---|
| 539 | log_OS_error(command);
|
---|
| 540 | }
|
---|
| 541 | }
|
---|
| 542 | /* chdir(old_pwd); */
|
---|
[273] | 543 | // sprintf (tmp, "uniq -u %s >> %s", "/tmp/mondo-verify.err", MONDO_LOGFILE);
|
---|
[128] | 544 | // paranoid_system (tmp);
|
---|
| 545 | // unlink ("/tmp/mondo-verify.err");
|
---|
| 546 | paranoid_free(command);
|
---|
| 547 | paranoid_free(outlog);
|
---|
| 548 | paranoid_free(tmp);
|
---|
| 549 | return (0);
|
---|
[1] | 550 | }
|
---|
| 551 |
|
---|
| 552 |
|
---|
| 553 |
|
---|
| 554 |
|
---|
| 555 |
|
---|
| 556 |
|
---|
| 557 | /**
|
---|
| 558 | * Verify one afioball from the CD.
|
---|
| 559 | * Checks for existence (calls fatal_error() if it does not exist) and
|
---|
| 560 | * then calls verify_an_afioball().
|
---|
| 561 | * @param bkpinfo The backup information structure. Passed to verify_an_afioball().
|
---|
| 562 | * @param tarball_fname The filename of the afioball to verify.
|
---|
| 563 | * @return The return value of verify_an_afioball().
|
---|
| 564 | * @see verify_an_afioball
|
---|
| 565 | */
|
---|
| 566 | int
|
---|
[1645] | 567 | verify_an_afioball_from_CD(char *tarball_fname)
|
---|
[1] | 568 | {
|
---|
| 569 |
|
---|
[128] | 570 | /*@ int ************************************************************* */
|
---|
| 571 | int res = 0;
|
---|
[1] | 572 |
|
---|
[128] | 573 | assert_string_is_neither_NULL_nor_zerolength(tarball_fname);
|
---|
[1] | 574 |
|
---|
[128] | 575 | log_msg(1, "Verifying %s", tarball_fname);
|
---|
| 576 | if (!does_file_exist(tarball_fname)) {
|
---|
| 577 | fatal_error("Cannot verify nonexistent afioball");
|
---|
| 578 | }
|
---|
[1645] | 579 | res = verify_a_tarball(tarball_fname);
|
---|
[128] | 580 | return (res);
|
---|
[1] | 581 | }
|
---|
| 582 |
|
---|
| 583 |
|
---|
| 584 | /**
|
---|
| 585 | * Verify one afioball from the opened tape/CD stream.
|
---|
| 586 | * Copies the file from tape to tmpdir and then calls verify_an_afioball().
|
---|
| 587 | * @param bkpinfo The backup information structure. Passed to verify_an_afioball().
|
---|
| 588 | * @param orig_fname The original filename of the afioball to verify.
|
---|
| 589 | * @param size The size of the afioball to verify.
|
---|
| 590 | * @return The return value of verify_an_afioball().
|
---|
| 591 | * @see verify_an_afioball
|
---|
| 592 | */
|
---|
| 593 | int
|
---|
[1645] | 594 | verify_an_afioball_from_stream(char *orig_fname, long long size)
|
---|
[1] | 595 | {
|
---|
| 596 |
|
---|
[128] | 597 | /*@ int ************************************************************** */
|
---|
| 598 | int retval = 0;
|
---|
[1] | 599 | int res = 0;
|
---|
| 600 |
|
---|
[128] | 601 | /*@ buffers ********************************************************** */
|
---|
| 602 | char *tmp;
|
---|
[1] | 603 | char *tarball_fname;
|
---|
| 604 |
|
---|
[128] | 605 | /*@ pointers ********************************************************* */
|
---|
| 606 | char *p;
|
---|
[1] | 607 |
|
---|
[128] | 608 | malloc_string(tmp);
|
---|
| 609 | malloc_string(tarball_fname);
|
---|
| 610 | assert(bkpinfo != NULL);
|
---|
| 611 | assert_string_is_neither_NULL_nor_zerolength(orig_fname);
|
---|
[1] | 612 |
|
---|
[128] | 613 | p = strrchr(orig_fname, '/');
|
---|
| 614 | if (!p) {
|
---|
| 615 | p = orig_fname;
|
---|
| 616 | } else {
|
---|
| 617 | p++;
|
---|
| 618 | }
|
---|
| 619 | sprintf(tmp, "mkdir -p %s/tmpfs", bkpinfo->tmpdir);
|
---|
| 620 | paranoid_system(tmp);
|
---|
| 621 | sprintf(tarball_fname, "%s/tmpfs/temporary-%s", bkpinfo->tmpdir, p);
|
---|
| 622 | sprintf(tmp, "Temporarily copying file from tape to '%s'",
|
---|
| 623 | tarball_fname);
|
---|
[1] | 624 | /* log_it(tmp); */
|
---|
[1645] | 625 | read_file_from_stream_to_file(tarball_fname, size);
|
---|
| 626 | res = verify_a_tarball(tarball_fname);
|
---|
[128] | 627 | if (res) {
|
---|
| 628 | sprintf(tmp,
|
---|
| 629 | "Afioball '%s' no longer matches your live filesystem", p);
|
---|
| 630 | log_msg(0, tmp);
|
---|
| 631 | retval++;
|
---|
| 632 | }
|
---|
| 633 | unlink(tarball_fname);
|
---|
| 634 | paranoid_free(tmp);
|
---|
| 635 | paranoid_free(tarball_fname);
|
---|
| 636 | return (retval);
|
---|
[1] | 637 | }
|
---|
| 638 |
|
---|
| 639 |
|
---|
| 640 | /**
|
---|
| 641 | * Verify one biggiefile form the opened tape/CD stream.
|
---|
| 642 | * @param bkpinfo The backup information structure. @c bkpinfo->tmpdir is the only field used.
|
---|
| 643 | * @param biggie_fname The filename of the biggiefile to verify.
|
---|
| 644 | * @param size The size in bytes of said biggiefile.
|
---|
| 645 | * @return 0 for success (even if the file doesn't match); nonzero for a tape error.
|
---|
| 646 | */
|
---|
| 647 | int
|
---|
[1645] | 648 | verify_a_biggiefile_from_stream(char *biggie_fname, long long size)
|
---|
[1] | 649 | {
|
---|
| 650 |
|
---|
[128] | 651 | /*@ int ************************************************************* */
|
---|
| 652 | int retval = 0;
|
---|
[1] | 653 | int res = 0;
|
---|
| 654 | int current_slice_number = 0;
|
---|
| 655 | int ctrl_chr = '\0';
|
---|
| 656 |
|
---|
[128] | 657 | /*@ char ************************************************************ */
|
---|
[1] | 658 | char *test_file;
|
---|
| 659 | char *biggie_cksum;
|
---|
| 660 | char *orig_cksum;
|
---|
| 661 | char *tmp;
|
---|
| 662 | char *slice_fnam;
|
---|
[128] | 663 |
|
---|
| 664 | /*@ pointers ******************************************************** */
|
---|
[1] | 665 | char *p;
|
---|
| 666 |
|
---|
[128] | 667 | /*@ long long ******************************************************* */
|
---|
| 668 | long long slice_siz;
|
---|
[1] | 669 |
|
---|
[128] | 670 | malloc_string(test_file);
|
---|
| 671 | malloc_string(biggie_cksum);
|
---|
| 672 | malloc_string(orig_cksum);
|
---|
| 673 | malloc_string(tmp);
|
---|
| 674 | malloc_string(slice_fnam);
|
---|
| 675 | assert(bkpinfo != NULL);
|
---|
| 676 | assert_string_is_neither_NULL_nor_zerolength(biggie_fname);
|
---|
[1] | 677 |
|
---|
[128] | 678 | p = strrchr(biggie_fname, '/');
|
---|
| 679 | if (!p) {
|
---|
| 680 | p = biggie_fname;
|
---|
| 681 | } else {
|
---|
| 682 | p++;
|
---|
| 683 | }
|
---|
| 684 | sprintf(test_file, "%s/temporary-%s", bkpinfo->tmpdir, p);
|
---|
| 685 | sprintf(tmp,
|
---|
| 686 | "Temporarily copying biggiefile %s's slices from tape to '%s'",
|
---|
| 687 | p, test_file);
|
---|
[1] | 688 | /* log_it(tmp); */
|
---|
[128] | 689 | for (res =
|
---|
| 690 | read_header_block_from_stream(&slice_siz, slice_fnam, &ctrl_chr);
|
---|
| 691 | ctrl_chr != BLK_STOP_A_BIGGIE;
|
---|
| 692 | res =
|
---|
| 693 | read_header_block_from_stream(&slice_siz, slice_fnam,
|
---|
| 694 | &ctrl_chr)) {
|
---|
| 695 | if (ctrl_chr != BLK_START_AN_AFIO_OR_SLICE) {
|
---|
| 696 | wrong_marker(BLK_START_AN_AFIO_OR_SLICE, ctrl_chr);
|
---|
| 697 | }
|
---|
[1645] | 698 | res = read_file_from_stream_to_file(test_file, slice_siz);
|
---|
[128] | 699 | unlink(test_file);
|
---|
| 700 | res =
|
---|
| 701 | read_header_block_from_stream(&slice_siz, slice_fnam,
|
---|
| 702 | &ctrl_chr);
|
---|
| 703 | if (ctrl_chr != BLK_STOP_AN_AFIO_OR_SLICE) {
|
---|
| 704 | log_msg(2, "test_file = %s", test_file);
|
---|
| 705 | wrong_marker(BLK_STOP_AN_AFIO_OR_SLICE, ctrl_chr);
|
---|
| 706 | }
|
---|
| 707 | current_slice_number++;
|
---|
| 708 | retval += res;
|
---|
[1] | 709 | }
|
---|
[128] | 710 | strcpy(biggie_cksum, slice_fnam);
|
---|
| 711 | if (biggie_cksum[0] != '\0') {
|
---|
| 712 | strcpy(orig_cksum, calc_checksum_of_file(biggie_fname));
|
---|
| 713 | if (strcmp(biggie_cksum, orig_cksum)) {
|
---|
| 714 | sprintf(tmp, "orig cksum=%s; curr cksum=%s", biggie_cksum,
|
---|
| 715 | orig_cksum);
|
---|
| 716 | log_msg(2, tmp);
|
---|
[541] | 717 | sprintf(tmp, "%s has changed on live filesystem",
|
---|
[128] | 718 | biggie_fname);
|
---|
| 719 | log_to_screen(tmp);
|
---|
[1644] | 720 | sprintf(tmp, "echo \"%s\" >> %s/biggies.changed",
|
---|
| 721 | biggie_fname, bkpinfo->tmpdir);
|
---|
[128] | 722 | system(tmp);
|
---|
| 723 | }
|
---|
[1] | 724 | }
|
---|
[128] | 725 | paranoid_free(test_file);
|
---|
| 726 | paranoid_free(biggie_cksum);
|
---|
| 727 | paranoid_free(orig_cksum);
|
---|
| 728 | paranoid_free(tmp);
|
---|
| 729 | paranoid_free(slice_fnam);
|
---|
| 730 | return (retval);
|
---|
[1] | 731 | }
|
---|
| 732 |
|
---|
| 733 |
|
---|
| 734 | /**
|
---|
| 735 | * Verify all afioballs from the opened tape/CD stream.
|
---|
| 736 | * @param bkpinfo The backup information structure. Fields used:
|
---|
| 737 | * - @c bkpinfo->restore_path
|
---|
| 738 | * - @c bkpinfo->tmpdir
|
---|
| 739 | *
|
---|
| 740 | * @return 0 for success (even if there are differences); nonzero for a tape error.
|
---|
| 741 | */
|
---|
[1645] | 742 | int verify_afioballs_from_stream()
|
---|
[1] | 743 | {
|
---|
[128] | 744 | /*@ int ********************************************************** */
|
---|
| 745 | int retval = 0;
|
---|
[1] | 746 | int res = 0;
|
---|
| 747 | long current_afioball_number = 0;
|
---|
| 748 | int ctrl_chr = 0;
|
---|
| 749 | int total_afioballs = 0;
|
---|
| 750 |
|
---|
[128] | 751 | /*@ buffers ***************************************************** */
|
---|
| 752 | char *tmp;
|
---|
[1] | 753 | char *fname;
|
---|
[128] | 754 | char *curr_xattr_list_fname;
|
---|
| 755 | char *curr_acl_list_fname;
|
---|
[1] | 756 |
|
---|
[128] | 757 | /*@ long long *************************************************** */
|
---|
| 758 | long long size = 0;
|
---|
[1] | 759 |
|
---|
[128] | 760 | assert(bkpinfo != NULL);
|
---|
| 761 | malloc_string(tmp);
|
---|
| 762 | malloc_string(fname);
|
---|
| 763 | malloc_string(curr_xattr_list_fname);
|
---|
| 764 | malloc_string(curr_acl_list_fname);
|
---|
[1] | 765 |
|
---|
[948] | 766 | if (g_getfattr) {
|
---|
| 767 | sprintf(curr_xattr_list_fname, XATTR_BIGGLST_FNAME_RAW_SZ,
|
---|
[128] | 768 | bkpinfo->tmpdir);
|
---|
[948] | 769 | }
|
---|
| 770 | if (g_getfacl) {
|
---|
| 771 | sprintf(curr_acl_list_fname, ACL_BIGGLST_FNAME_RAW_SZ,
|
---|
[128] | 772 | bkpinfo->tmpdir);
|
---|
[948] | 773 | }
|
---|
[541] | 774 | log_to_screen("Verifying regular archives on tape");
|
---|
[1645] | 775 | total_afioballs = get_last_filelist_number() + 1;
|
---|
[541] | 776 | open_progress_form("Verifying filesystem",
|
---|
| 777 | "I am verifying archives against your live filesystem now.",
|
---|
| 778 | "Please wait. This may take a couple of hours.", "",
|
---|
[128] | 779 | total_afioballs);
|
---|
| 780 | res = read_header_block_from_stream(&size, fname, &ctrl_chr);
|
---|
| 781 | if (ctrl_chr != BLK_START_AFIOBALLS) {
|
---|
[2230] | 782 | log_it("YOU SHOULD NOT GET HERE");
|
---|
| 783 | log_it("Grabbing the EXAT files");
|
---|
[128] | 784 | if (ctrl_chr == BLK_START_EXTENDED_ATTRIBUTES) {
|
---|
| 785 | res =
|
---|
[1645] | 786 | read_EXAT_files_from_tape(&size, fname, &ctrl_chr,
|
---|
[128] | 787 | curr_xattr_list_fname,
|
---|
| 788 | curr_acl_list_fname);
|
---|
| 789 | }
|
---|
[1] | 790 | }
|
---|
[128] | 791 | if (ctrl_chr != BLK_START_AFIOBALLS) {
|
---|
| 792 | wrong_marker(BLK_START_AFIOBALLS, ctrl_chr);
|
---|
[1] | 793 | }
|
---|
[128] | 794 |
|
---|
| 795 | for (res = read_header_block_from_stream(&size, fname, &ctrl_chr);
|
---|
| 796 | ctrl_chr != BLK_STOP_AFIOBALLS;
|
---|
| 797 | res = read_header_block_from_stream(&size, fname, &ctrl_chr)) {
|
---|
[948] | 798 | if (g_getfattr) {
|
---|
| 799 | sprintf(curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ,
|
---|
[128] | 800 | bkpinfo->tmpdir, current_afioball_number);
|
---|
[948] | 801 | }
|
---|
| 802 | if (g_getfacl) {
|
---|
| 803 | sprintf(curr_acl_list_fname, ACL_LIST_FNAME_RAW_SZ,
|
---|
[128] | 804 | bkpinfo->tmpdir, current_afioball_number);
|
---|
[948] | 805 | }
|
---|
[128] | 806 | if (ctrl_chr == BLK_START_EXTENDED_ATTRIBUTES) {
|
---|
[2230] | 807 | log_it("Reading EXAT files from tape");
|
---|
[128] | 808 | res =
|
---|
[1645] | 809 | read_EXAT_files_from_tape(&size, fname, &ctrl_chr,
|
---|
[128] | 810 | curr_xattr_list_fname,
|
---|
| 811 | curr_acl_list_fname);
|
---|
| 812 | }
|
---|
| 813 | if (ctrl_chr != BLK_START_AN_AFIO_OR_SLICE) {
|
---|
| 814 | wrong_marker(BLK_START_AN_AFIO_OR_SLICE, ctrl_chr);
|
---|
| 815 | }
|
---|
| 816 | sprintf(tmp, "Verifying fileset #%ld", current_afioball_number);
|
---|
| 817 | /*log_it(tmp); */
|
---|
| 818 | update_progress_form(tmp);
|
---|
[1645] | 819 | res = verify_an_afioball_from_stream(fname, size);
|
---|
[128] | 820 | if (res) {
|
---|
[541] | 821 | sprintf(tmp, "Afioball %ld differs from live filesystem",
|
---|
[128] | 822 | current_afioball_number);
|
---|
| 823 | log_to_screen(tmp);
|
---|
| 824 | }
|
---|
| 825 | retval += res;
|
---|
| 826 | current_afioball_number++;
|
---|
| 827 | g_current_progress++;
|
---|
| 828 | res = read_header_block_from_stream(&size, fname, &ctrl_chr);
|
---|
| 829 | if (ctrl_chr != BLK_STOP_AN_AFIO_OR_SLICE) {
|
---|
| 830 | wrong_marker(BLK_STOP_AN_AFIO_OR_SLICE, ctrl_chr);
|
---|
| 831 | }
|
---|
[1] | 832 | }
|
---|
[128] | 833 | log_msg(1, "All done with afioballs");
|
---|
| 834 | close_progress_form();
|
---|
| 835 | paranoid_free(tmp);
|
---|
| 836 | paranoid_free(fname);
|
---|
| 837 | paranoid_free(curr_xattr_list_fname);
|
---|
| 838 | paranoid_free(curr_acl_list_fname);
|
---|
| 839 | return (retval);
|
---|
[1] | 840 | }
|
---|
| 841 |
|
---|
| 842 | /**
|
---|
| 843 | * Verify all biggiefiles on the opened CD/tape stream.
|
---|
| 844 | * @param bkpinfo The backup information structure. Fields used:
|
---|
| 845 | * - @c bkpinfo->restore_path
|
---|
| 846 | * - @c bkpinfo->tmpdir
|
---|
| 847 | *
|
---|
| 848 | * @return 0 for success (even if there are differences); nonzero for a tape error.
|
---|
| 849 | */
|
---|
[1645] | 850 | int verify_biggiefiles_from_stream()
|
---|
[1] | 851 | {
|
---|
| 852 |
|
---|
[128] | 853 | /*@ int ************************************************************ */
|
---|
| 854 | int retval = 0;
|
---|
[1] | 855 | int res = 0;
|
---|
| 856 | int ctrl_chr = 0;
|
---|
| 857 |
|
---|
[128] | 858 | /*@ long *********************************************************** */
|
---|
| 859 | long noof_biggiefiles = 0;
|
---|
[1] | 860 | long current_biggiefile_number = 0;
|
---|
| 861 |
|
---|
[128] | 862 | /*@ buffers ******************************************************** */
|
---|
| 863 | char *tmp;
|
---|
[1] | 864 | char *orig_fname, *logical_fname;
|
---|
| 865 | char *comment;
|
---|
| 866 | char *curr_xattr_list_fname;
|
---|
| 867 | char *curr_acl_list_fname;
|
---|
[128] | 868 | /*@ pointers ******************************************************* */
|
---|
[1] | 869 | char *p;
|
---|
| 870 |
|
---|
[128] | 871 | /*@ long long size ************************************************* */
|
---|
| 872 | long long size = 0;
|
---|
[1] | 873 |
|
---|
[128] | 874 | assert(bkpinfo != NULL);
|
---|
| 875 | malloc_string(tmp);
|
---|
| 876 | malloc_string(orig_fname);
|
---|
| 877 | malloc_string(logical_fname);
|
---|
| 878 | malloc_string(comment);
|
---|
| 879 | malloc_string(curr_xattr_list_fname);
|
---|
| 880 | malloc_string(curr_acl_list_fname);
|
---|
[1] | 881 |
|
---|
[948] | 882 | if (g_getfattr) {
|
---|
| 883 | sprintf(curr_xattr_list_fname, XATTR_BIGGLST_FNAME_RAW_SZ,
|
---|
[128] | 884 | bkpinfo->tmpdir);
|
---|
[948] | 885 | }
|
---|
| 886 | if (g_getfacl) {
|
---|
| 887 | sprintf(curr_acl_list_fname, ACL_BIGGLST_FNAME_RAW_SZ,
|
---|
[128] | 888 | bkpinfo->tmpdir);
|
---|
[948] | 889 | }
|
---|
[128] | 890 | sprintf(comment, "Verifying all bigfiles.");
|
---|
| 891 | log_to_screen(comment);
|
---|
| 892 | sprintf(tmp, "%s/biggielist.txt", bkpinfo->tmpdir);
|
---|
[1] | 893 | // noof_biggiefiles = count_lines_in_file (tmp); // pointless
|
---|
[128] | 894 | res = read_header_block_from_stream(&size, orig_fname, &ctrl_chr);
|
---|
| 895 | if (ctrl_chr != BLK_START_BIGGIEFILES) {
|
---|
| 896 | if (ctrl_chr == BLK_START_EXTENDED_ATTRIBUTES) {
|
---|
[2230] | 897 | log_it("Grabbing the EXAT biggiefiles");
|
---|
[128] | 898 | res =
|
---|
[1645] | 899 | read_EXAT_files_from_tape(&size, orig_fname,
|
---|
[128] | 900 | &ctrl_chr, curr_xattr_list_fname,
|
---|
| 901 | curr_acl_list_fname);
|
---|
| 902 | }
|
---|
[1] | 903 | }
|
---|
[128] | 904 | if (ctrl_chr != BLK_START_BIGGIEFILES) {
|
---|
| 905 | wrong_marker(BLK_START_BIGGIEFILES, ctrl_chr);
|
---|
[1] | 906 | }
|
---|
[128] | 907 | noof_biggiefiles = (long) size;
|
---|
| 908 | log_msg(1, "noof_biggiefiles = %ld", noof_biggiefiles);
|
---|
[541] | 909 | open_progress_form("Verifying big files", comment,
|
---|
| 910 | "Please wait. This may take some time.", "",
|
---|
[128] | 911 | noof_biggiefiles);
|
---|
| 912 | for (res = read_header_block_from_stream(&size, orig_fname, &ctrl_chr);
|
---|
| 913 | ctrl_chr != BLK_STOP_BIGGIEFILES;
|
---|
| 914 | res = read_header_block_from_stream(&size, orig_fname, &ctrl_chr))
|
---|
[1] | 915 | {
|
---|
[128] | 916 | if (ctrl_chr != BLK_START_A_NORMBIGGIE
|
---|
| 917 | && ctrl_chr != BLK_START_A_PIHBIGGIE) {
|
---|
| 918 | wrong_marker(BLK_START_A_NORMBIGGIE, ctrl_chr);
|
---|
| 919 | }
|
---|
| 920 | p = strrchr(orig_fname, '/');
|
---|
| 921 | if (!p) {
|
---|
| 922 | p = orig_fname;
|
---|
| 923 | } else {
|
---|
| 924 | p++;
|
---|
| 925 | }
|
---|
[541] | 926 | sprintf(comment, "Verifying bigfile #%ld (%ld K)",
|
---|
[128] | 927 | current_biggiefile_number, (long) size >> 10);
|
---|
| 928 | update_progress_form(comment);
|
---|
| 929 | sprintf(logical_fname, "%s/%s", bkpinfo->restore_path, orig_fname);
|
---|
| 930 | res =
|
---|
[1645] | 931 | verify_a_biggiefile_from_stream(logical_fname, size);
|
---|
[128] | 932 | retval += res;
|
---|
| 933 | current_biggiefile_number++;
|
---|
| 934 | g_current_progress++;
|
---|
[1] | 935 | }
|
---|
[128] | 936 | close_progress_form();
|
---|
| 937 | paranoid_free(orig_fname);
|
---|
| 938 | paranoid_free(logical_fname);
|
---|
| 939 | paranoid_free(curr_xattr_list_fname);
|
---|
| 940 | paranoid_free(curr_acl_list_fname);
|
---|
| 941 | paranoid_free(comment);
|
---|
| 942 | paranoid_free(tmp);
|
---|
| 943 | return (retval);
|
---|
[1] | 944 | }
|
---|
| 945 |
|
---|
| 946 | /* @} - end of LLverifyGroup */
|
---|
| 947 |
|
---|
| 948 |
|
---|
| 949 | /**
|
---|
[1709] | 950 | * Verify the USB device
|
---|
| 951 | * @param bkpinfo The backup information structure. Fields used:
|
---|
| 952 | * - @c bkpinfo->isodir
|
---|
| 953 | * - @c bkpinfo->media_device
|
---|
| 954 | * - @c bkpinfo->tmpdir
|
---|
| 955 | * - @c bkpinfo->verify_data
|
---|
| 956 | *
|
---|
| 957 | * @return 0 for success (even if differences are found), nonzero for failure.
|
---|
| 958 | * @ingroup verifyGroup
|
---|
| 959 | */
|
---|
| 960 | int verify_usb_image()
|
---|
| 961 | {
|
---|
| 962 |
|
---|
| 963 | /*@ int ************************************************************ */
|
---|
| 964 | int retval = 0;
|
---|
| 965 |
|
---|
| 966 | /*@ buffers ******************************************************** */
|
---|
| 967 | char *mountpoint = NULL;
|
---|
| 968 | char *tmp = NULL;
|
---|
| 969 | char *tmp1 = NULL;
|
---|
| 970 | char *fname = NULL;
|
---|
[1711] | 971 | int ret = 0;
|
---|
[1709] | 972 | #ifdef __FreeBSD__
|
---|
| 973 | char mdd[32];
|
---|
| 974 | char *mddevice = mdd;
|
---|
| 975 | int vndev = 2;
|
---|
| 976 | #else
|
---|
| 977 | //skip
|
---|
| 978 | #endif
|
---|
| 979 |
|
---|
| 980 | assert(bkpinfo != NULL);
|
---|
| 981 |
|
---|
[2211] | 982 | mr_asprintf(&fname, "%s1", bkpinfo->media_device);
|
---|
[1709] | 983 | if (is_this_device_mounted(fname)) {
|
---|
| 984 | log_msg(1, "USB device mounted. Remounting it at the right place");
|
---|
[2211] | 985 | mr_asprintf(&tmp, "umount %s", fname);
|
---|
[1709] | 986 | run_program_and_log_output(tmp, FALSE);
|
---|
| 987 | paranoid_free(tmp);
|
---|
| 988 | }
|
---|
| 989 | paranoid_free(fname);
|
---|
| 990 |
|
---|
| 991 | log_msg(1, "Mounting USB device.");
|
---|
[2211] | 992 | mr_asprintf(&mountpoint, "%s/usb", bkpinfo->tmpdir);
|
---|
| 993 | mr_asprintf(&tmp, "mkdir -p %s", mountpoint);
|
---|
[1709] | 994 | run_program_and_log_output(tmp, FALSE);
|
---|
| 995 | paranoid_free(tmp);
|
---|
| 996 | /* Mindi always create one single parition on the USB dev */
|
---|
[2211] | 997 | mr_asprintf(&tmp, "mount %s1 %s", bkpinfo->media_device, mountpoint);
|
---|
[1709] | 998 | ret = run_program_and_log_output(tmp, FALSE);
|
---|
| 999 | paranoid_free(tmp);
|
---|
| 1000 | if (ret) {
|
---|
| 1001 | paranoid_free(mountpoint);
|
---|
| 1002 | return(ret);
|
---|
| 1003 | }
|
---|
| 1004 |
|
---|
| 1005 | sync();
|
---|
| 1006 | log_msg(2, "OK, I've mounted the USB Disk/Key\n");
|
---|
[2211] | 1007 | mr_asprintf(&tmp, "%s/archives/NOT-THE-LAST", mountpoint);
|
---|
[1709] | 1008 | if (!does_file_exist(tmp)) {
|
---|
| 1009 | log_msg
|
---|
| 1010 | (2,
|
---|
| 1011 | "This is the last USB device. I am therefore setting bkpinfo->verify_data to FALSE.");
|
---|
| 1012 | bkpinfo->verify_data = FALSE;
|
---|
| 1013 | /*
|
---|
| 1014 | (a) It's an easy way to tell the calling subroutine that we've finished &
|
---|
| 1015 | there are no more device to be verified; (b) It stops the post-backup verifier
|
---|
| 1016 | from running after the per-device verifier has run too.
|
---|
| 1017 | */
|
---|
| 1018 | }
|
---|
| 1019 | paranoid_free(tmp);
|
---|
| 1020 | verify_afioballs_on_CD(mountpoint);
|
---|
[2230] | 1021 | log_it("before verify_all_slices");
|
---|
[1709] | 1022 | verify_all_slices_on_CD(mountpoint);
|
---|
| 1023 |
|
---|
[2211] | 1024 | mr_asprintf(&tmp1, "umount %s", mountpoint);
|
---|
[1709] | 1025 | #ifdef __FreeBSD__
|
---|
| 1026 | ret += system(tmp1);
|
---|
| 1027 | ret += kick_vn(mddevice);
|
---|
| 1028 | if (ret)
|
---|
| 1029 | #else
|
---|
| 1030 | if (system(tmp1))
|
---|
| 1031 | #endif
|
---|
| 1032 | {
|
---|
[2211] | 1033 | mr_asprintf(&tmp, "%s failed; unable to unmount USB device\n", tmp1);
|
---|
[1709] | 1034 | log_to_screen(tmp);
|
---|
| 1035 | paranoid_free(tmp);
|
---|
| 1036 | retval++;
|
---|
| 1037 | } else {
|
---|
| 1038 | log_msg(2, "OK, I've unmounted the USB device\n");
|
---|
| 1039 | }
|
---|
| 1040 | paranoid_free(tmp1);
|
---|
| 1041 | paranoid_free(mountpoint);
|
---|
| 1042 | return (retval);
|
---|
| 1043 | }
|
---|
| 1044 |
|
---|
| 1045 |
|
---|
| 1046 | /**
|
---|
[1] | 1047 | * Verify the CD indicated by @c g_current_media_number.
|
---|
| 1048 | * @param bkpinfo The backup information structure. Fields used:
|
---|
| 1049 | * - @c bkpinfo->isodir
|
---|
[20] | 1050 | * - @c bkpinfo->prefix
|
---|
[1] | 1051 | * - @c bkpinfo->manual_cd_tray
|
---|
| 1052 | * - @c bkpinfo->media_device
|
---|
| 1053 | * - @c bkpinfo->nfs_remote_dir
|
---|
| 1054 | * - @c bkpinfo->tmpdir
|
---|
| 1055 | * - @c bkpinfo->verify_data
|
---|
| 1056 | *
|
---|
| 1057 | * @return 0 for success (even if differences are found), nonzero for failure.
|
---|
| 1058 | * @ingroup verifyGroup
|
---|
| 1059 | */
|
---|
[1645] | 1060 | int verify_cd_image()
|
---|
[1] | 1061 | {
|
---|
| 1062 |
|
---|
[128] | 1063 | /*@ int ************************************************************ */
|
---|
| 1064 | int retval = 0;
|
---|
[1] | 1065 |
|
---|
[128] | 1066 | /*@ buffers ******************************************************** */
|
---|
| 1067 | char *mountpoint;
|
---|
[1] | 1068 | char *command;
|
---|
| 1069 | char *tmp;
|
---|
| 1070 | char *fname;
|
---|
| 1071 | #ifdef __FreeBSD__
|
---|
[128] | 1072 | char mdd[32];
|
---|
[1] | 1073 | char *mddevice = mdd;
|
---|
[128] | 1074 | int ret = 0;
|
---|
| 1075 | int vndev = 2;
|
---|
[1] | 1076 | #else
|
---|
| 1077 | //skip
|
---|
| 1078 | #endif
|
---|
| 1079 |
|
---|
[128] | 1080 | command = malloc(2000);
|
---|
| 1081 | malloc_string(mountpoint);
|
---|
| 1082 | malloc_string(tmp);
|
---|
| 1083 | malloc_string(fname);
|
---|
[1] | 1084 |
|
---|
[128] | 1085 | assert(bkpinfo != NULL);
|
---|
[1] | 1086 |
|
---|
[128] | 1087 | sprintf(mountpoint, "%s/cdrom", bkpinfo->tmpdir);
|
---|
[543] | 1088 | sprintf(fname, "%s/%s/%s-%d.iso", bkpinfo->isodir, bkpinfo->nfs_remote_dir,
|
---|
| 1089 | bkpinfo->prefix, g_current_media_number);
|
---|
[128] | 1090 |
|
---|
| 1091 | mkdir(mountpoint, 1777);
|
---|
| 1092 | sync();
|
---|
| 1093 | if (!does_file_exist(fname)) {
|
---|
| 1094 | sprintf(tmp,
|
---|
| 1095 | "%s not found; assuming you backed up to CD; verifying CD...",
|
---|
| 1096 | fname);
|
---|
| 1097 | log_msg(2, tmp);
|
---|
| 1098 | if (bkpinfo->manual_cd_tray) {
|
---|
[541] | 1099 | popup_and_OK("Please push CD tray closed.");
|
---|
[128] | 1100 | }
|
---|
[1645] | 1101 | if (find_and_mount_actual_cd(mountpoint)) {
|
---|
[541] | 1102 | log_to_screen("failed to mount actual CD");
|
---|
[128] | 1103 | return (1);
|
---|
| 1104 | }
|
---|
| 1105 | } else {
|
---|
| 1106 | sprintf(tmp, "%s found; verifying ISO...", fname);
|
---|
[1] | 1107 | #ifdef __FreeBSD__
|
---|
[128] | 1108 | ret = 0;
|
---|
| 1109 | vndev = 2;
|
---|
| 1110 | mddevice = make_vn(fname);
|
---|
| 1111 | if (ret) {
|
---|
[541] | 1112 | sprintf(tmp, "make_vn of %s failed; unable to verify ISO\n",
|
---|
[128] | 1113 | fname);
|
---|
| 1114 | log_to_screen(tmp);
|
---|
| 1115 | return (1);
|
---|
| 1116 | }
|
---|
| 1117 | sprintf(command, "mount_cd9660 %s %s", mddevice, mountpoint);
|
---|
[1] | 1118 | #else
|
---|
[128] | 1119 | sprintf(command, "mount -o loop,ro -t iso9660 %s %s", fname,
|
---|
| 1120 | mountpoint);
|
---|
[1] | 1121 | #endif
|
---|
[128] | 1122 | if (run_program_and_log_output(command, FALSE)) {
|
---|
[541] | 1123 | sprintf(tmp, "%s failed; unable to mount ISO image\n",
|
---|
[128] | 1124 | command);
|
---|
| 1125 | log_to_screen(tmp);
|
---|
| 1126 | return (1);
|
---|
| 1127 | }
|
---|
[1] | 1128 | }
|
---|
[128] | 1129 | log_msg(2, "OK, I've mounted the ISO/CD\n");
|
---|
| 1130 | sprintf(tmp, "%s/archives/NOT-THE-LAST", mountpoint);
|
---|
| 1131 | if (!does_file_exist(tmp)) {
|
---|
| 1132 | log_msg
|
---|
| 1133 | (2,
|
---|
| 1134 | "This is the last CD. I am therefore setting bkpinfo->verify_data to FALSE.");
|
---|
| 1135 | bkpinfo->verify_data = FALSE;
|
---|
[1] | 1136 | /*
|
---|
| 1137 | (a) It's an easy way to tell the calling subroutine that we've finished &
|
---|
| 1138 | there are no more CD's to be verified; (b) It stops the post-backup verifier
|
---|
| 1139 | from running after the per-CD verifier has run too.
|
---|
| 1140 | */
|
---|
[128] | 1141 | }
|
---|
[1645] | 1142 | verify_afioballs_on_CD(mountpoint);
|
---|
[2230] | 1143 | log_it("before verify_all_slices");
|
---|
[1645] | 1144 | verify_all_slices_on_CD(mountpoint);
|
---|
[1] | 1145 |
|
---|
| 1146 | #ifdef __FreeBSD__
|
---|
[128] | 1147 | ret = 0;
|
---|
| 1148 | sprintf(command, "umount %s", mountpoint);
|
---|
| 1149 | ret += system(command);
|
---|
| 1150 | ret += kick_vn(mddevice);
|
---|
| 1151 | if (ret)
|
---|
[1] | 1152 | #else
|
---|
[128] | 1153 | sprintf(command, "umount %s", mountpoint);
|
---|
| 1154 | if (system(command))
|
---|
[1] | 1155 | #endif
|
---|
| 1156 | {
|
---|
[128] | 1157 | sprintf(tmp, "%s failed; unable to unmount ISO image\n", command);
|
---|
| 1158 | log_to_screen(tmp);
|
---|
| 1159 | retval++;
|
---|
| 1160 | } else {
|
---|
| 1161 | log_msg(2, "OK, I've unmounted the ISO file\n");
|
---|
[1] | 1162 | }
|
---|
[128] | 1163 | if (!does_file_exist(fname)) {
|
---|
| 1164 | sprintf(command, "umount %s", bkpinfo->media_device);
|
---|
| 1165 | run_program_and_log_output(command, 2);
|
---|
| 1166 | if (!bkpinfo->please_dont_eject
|
---|
| 1167 | && eject_device(bkpinfo->media_device)) {
|
---|
| 1168 | log_msg(2, "Failed to eject CD-ROM drive");
|
---|
| 1169 | }
|
---|
| 1170 | }
|
---|
| 1171 | paranoid_free(command);
|
---|
| 1172 | paranoid_free(mountpoint);
|
---|
| 1173 | paranoid_free(tmp);
|
---|
| 1174 | paranoid_free(fname);
|
---|
| 1175 | return (retval);
|
---|
[1] | 1176 | }
|
---|
| 1177 |
|
---|
| 1178 | /**
|
---|
| 1179 | * Verify all backups on tape.
|
---|
| 1180 | * This should be done after the backup process has already closed the tape.
|
---|
| 1181 | * @param bkpinfo The backup information structure. Passed to various helper functions.
|
---|
| 1182 | * @return 0 for success (even if thee were differences), nonzero for failure.
|
---|
| 1183 | * @ingroup verifyGroup
|
---|
| 1184 | */
|
---|
[1645] | 1185 | int verify_tape_backups()
|
---|
[1] | 1186 | {
|
---|
| 1187 |
|
---|
[128] | 1188 | /*@ int ************************************************************ */
|
---|
| 1189 | int retval = 0;
|
---|
[1] | 1190 |
|
---|
[128] | 1191 | /*@ buffers ******************************************************** */
|
---|
| 1192 | char tmp[MAX_STR_LEN];
|
---|
| 1193 | char changed_files_fname[MAX_STR_LEN];
|
---|
[1] | 1194 |
|
---|
[128] | 1195 | /*@ long *********************************************************** */
|
---|
| 1196 | long diffs = 0;
|
---|
[1] | 1197 |
|
---|
[128] | 1198 | assert(bkpinfo != NULL);
|
---|
[1] | 1199 |
|
---|
[128] | 1200 | log_msg(3, "verify_tape_backups --- starting");
|
---|
[541] | 1201 | log_to_screen("Verifying backups");
|
---|
[1645] | 1202 | openin_tape();
|
---|
[1] | 1203 | /* verify archives themselves */
|
---|
[1645] | 1204 | retval += verify_afioballs_from_stream();
|
---|
| 1205 | retval += verify_biggiefiles_from_stream();
|
---|
[1] | 1206 | /* find the final blocks */
|
---|
[128] | 1207 | paranoid_system("sync");
|
---|
| 1208 | sleep(2);
|
---|
[1645] | 1209 | closein_tape();
|
---|
[1] | 1210 | /* close tape; exit */
|
---|
| 1211 | // fclose(g_tape_stream); <-- not needed; is handled by closein_tape()
|
---|
[1644] | 1212 | sprintf(tmp, "rm -f %s/biggies.changed %s/changed.files 2> /dev/null", bkpinfo->tmpdir, bkpinfo->tmpdir);
|
---|
| 1213 | paranoid_system(tmp);
|
---|
| 1214 | sprintf(changed_files_fname, "%s/changed.files", bkpinfo->tmpdir);
|
---|
[128] | 1215 | sprintf(tmp,
|
---|
[911] | 1216 | "grep -E '^%s:.*$' %s | cut -d'\"' -f2 | sort -u | awk '{print \"/\"$0;};' | tr -s '/' '/' | grep -v \"(total of\" | grep -v \"incheckentry.*xwait\" | grep -vE '^/afio:.*$' | grep -vE '^dev/.*$' > %s",
|
---|
[273] | 1217 | (bkpinfo->use_star) ? "star" : "afio", MONDO_LOGFILE,
|
---|
[128] | 1218 | changed_files_fname);
|
---|
| 1219 | log_msg(2, "Running command to derive list of changed files");
|
---|
| 1220 | log_msg(2, tmp);
|
---|
| 1221 | if (system(tmp)) {
|
---|
| 1222 | if (does_file_exist(changed_files_fname)
|
---|
| 1223 | && length_of_file(changed_files_fname) > 2) {
|
---|
| 1224 | log_to_screen
|
---|
[541] | 1225 | ("Warning - unable to check logfile to derive list of changed files");
|
---|
[128] | 1226 | } else {
|
---|
| 1227 | log_to_screen
|
---|
[541] | 1228 | ("No differences found. Therefore, no 'changed.files' text file.");
|
---|
[128] | 1229 | }
|
---|
| 1230 | }
|
---|
[1644] | 1231 | sprintf(tmp, "cat %s/biggies.changed >> %s", bkpinfo->tmpdir, changed_files_fname);
|
---|
[128] | 1232 | paranoid_system(tmp);
|
---|
[1] | 1233 |
|
---|
[128] | 1234 | diffs = count_lines_in_file(changed_files_fname);
|
---|
| 1235 | if (diffs > 0) {
|
---|
[1644] | 1236 | sprintf(tmp, "cp -f %s %s/changed.files", changed_files_fname,
|
---|
[1747] | 1237 | MONDO_CACHE);
|
---|
[128] | 1238 | run_program_and_log_output(tmp, FALSE);
|
---|
| 1239 | sprintf(tmp,
|
---|
[1644] | 1240 | "%ld files differed from live filesystem; type less %s or less %s/changed.files to see",
|
---|
[1747] | 1241 | diffs, changed_files_fname, MONDO_CACHE);
|
---|
[128] | 1242 | log_msg(0, tmp);
|
---|
[1747] | 1243 | log_to_screen("See "MONDO_CACHE"/changed.files for a list of nonmatching files.");
|
---|
[1644] | 1244 | log_to_screen("The files probably changed on filesystem, not on backup media.");
|
---|
[128] | 1245 | // retval++;
|
---|
| 1246 | }
|
---|
| 1247 | return (retval);
|
---|
[1] | 1248 | }
|
---|
| 1249 |
|
---|
| 1250 |
|
---|
| 1251 |
|
---|