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