Ignore:
Timestamp:
Feb 8, 2007, 12:10:16 AM (13 years ago)
Author:
Bruno Cornec
Message:

log_msg => mr_msg for main files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/mondorestore/mondo-restore.c

    r1080 r1108  
    163163    int retval = 0, res = 0;
    164164
    165     log_msg(2, "let_user_edit_the_mountlist() --- starting");
     165    mr_msg(2, "let_user_edit_the_mountlist() --- starting");
    166166
    167167    assert(bkpinfo != NULL);
     
    170170    if (!bkpinfo->disaster_recovery) {
    171171        strcpy(g_mountlist_fname, "/tmp/mountlist.txt");
    172         log_msg(2, "I guess you're testing edit_mountlist()");
     172        mr_msg(2, "I guess you're testing edit_mountlist()");
    173173    }
    174174    if (!does_file_exist(g_mountlist_fname)) {
     
    218218    for (i = 0; i < mountlist->entries; i++) {
    219219        if (strstr(mountlist->el[i].format, "ompaq")) {
    220             log_msg(2, "mountlist[%d] (%s) is %s (Compaq alert!)",
     220            mr_msg(2, "mountlist[%d] (%s) is %s (Compaq alert!)",
    221221                    i, mountlist->el[i].device, mountlist->el[i].format);
    222222
     
    296296    if (bkpinfo->backup_media_type == iso) {
    297297        if (iso_fiddly_bits(bkpinfo, (c == 'N') ? TRUE : FALSE)) {
    298             log_msg(2,
     298            mr_msg(2,
    299299                    "catchall_mode --- iso_fiddly_bits returned w/ error");
    300300            return (1);
    301301        } else {
    302             log_msg(2, "catchall_mode --- iso_fiddly_bits ok");
     302            mr_msg(2, "catchall_mode --- iso_fiddly_bits ok");
    303303        }
    304304    }
    305305
    306306    if (c == 'I') {
    307         log_msg(2, "IM selected");
     307        mr_msg(2, "IM selected");
    308308        retval += interactive_mode(bkpinfo, mountlist, raidlist);
    309309    } else if (c == 'N') {
    310         log_msg(2, "NM selected");
     310        mr_msg(2, "NM selected");
    311311        retval += nuke_mode(bkpinfo, mountlist, raidlist);
    312312    } else if (c == 'C') {
    313         log_msg(2, "CM selected");
     313        mr_msg(2, "CM selected");
    314314        retval += compare_mode(bkpinfo, mountlist, raidlist);
    315315    }
     
    400400    /* try to partition and format */
    401401
    402     log_msg(2, "interactive_mode --- starting (great, assertions OK)");
     402    mr_msg(2, "interactive_mode --- starting (great, assertions OK)");
    403403
    404404    malloc_string(tmp);
     
    409409    assert(raidlist != NULL);
    410410
    411     log_msg(2, "interactive_mode --- assertions OK");
     411    mr_msg(2, "interactive_mode --- assertions OK");
    412412
    413413    if (g_text_mode) {
     
    433433#endif
    434434    {
    435         log_msg(1, "Not resizing mountlist.");
     435        mr_msg(1, "Not resizing mountlist.");
    436436    } else {
    437437        resize_mountlist_proportionately_to_suit_new_drives(mountlist);
     
    451451            paranoid_MR_finish(1);
    452452        }
    453         log_msg(2, "Proceeding...");
     453        mr_msg(2, "Proceeding...");
    454454        save_mountlist_to_disk(mountlist, g_mountlist_fname);
    455455        save_raidlist_to_raidtab(raidlist, RAIDTAB_FNAME);
     
    534534         ask_me_yes_or_no("Do you want me to restore all of your data?")))
    535535    {
    536         log_msg(1, "Restoring all data");
     536        mr_msg(1, "Restoring all data");
    537537        retval += restore_everything(bkpinfo, NULL);
    538538    } else
     
    561561                    }
    562562                    strcpy(bkpinfo->restore_path, tmp);
    563                     log_msg(1, "Restoring subset");
     563                    mr_msg(1, "Restoring subset");
    564564                    retval += restore_everything(bkpinfo, filelist);
    565565                    free_filelist(filelist);
     
    666666    assert(raidlist != NULL);
    667667    if (iso_fiddly_bits(bkpinfo, nuke_me_please)) {
    668         log_msg(1, "iso_mode --- returning w/ error");
     668        mr_msg(1, "iso_mode --- returning w/ error");
    669669        return (1);
    670670    } else {
     
    732732    assert(raidlist != NULL);
    733733
    734     log_msg(2, "nuke_mode --- starting");
     734    mr_msg(2, "nuke_mode --- starting");
    735735
    736736    get_cfg_file_from_archive_or_bust(bkpinfo);
     
    746746#endif
    747747    {
    748         log_msg(2, "Not resizing mountlist.");
     748        mr_msg(2, "Not resizing mountlist.");
    749749    } else {
    750750        resize_mountlist_proportionately_to_suit_new_drives(mountlist);
     
    784784#endif
    785785            {
    786                 log_msg(2,
     786                mr_msg(2,
    787787                        "Not partitioning drives due to 'nopart' option.");
    788788                res = 0;
     
    831831    retval += restore_everything(bkpinfo, NULL);
    832832    if (!run_boot_loader(FALSE)) {
    833         log_msg(1,
     833        mr_msg(1,
    834834                "Great! Boot loader was installed. No need for msg at end.");
    835835        boot_loader_installed = TRUE;
     
    910910    struct s_node *filelist;
    911911
    912     log_msg(1, "restore_to_live_filesystem() - starting");
     912    mr_msg(1, "restore_to_live_filesystem() - starting");
    913913    assert(bkpinfo != NULL);
    914914    malloc_string(old_restpath);
     
    923923    }
    924924    interactively_obtain_media_parameters_from_user(bkpinfo, FALSE);
    925     log_msg(2, "bkpinfo->media_device = %s", bkpinfo->media_device);
     925    mr_msg(2, "bkpinfo->media_device = %s", bkpinfo->media_device);
    926926    if (!bkpinfo->media_device[0]) {
    927         log_msg(2, "Warning - failed to find media dev");
    928     }
    929 
    930 
    931     log_msg(2, "bkpinfo->isodir = %s", bkpinfo->isodir);
     927        mr_msg(2, "Warning - failed to find media dev");
     928    }
     929
     930
     931    mr_msg(2, "bkpinfo->isodir = %s", bkpinfo->isodir);
    932932
    933933    open_evalcall_form("Thinking...");
     
    957957    }
    958958    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    959         log_msg(2,
     959        mr_msg(2,
    960960                "I probably don't need to unmount or eject the CD-ROM but I'm doing it anyway.");
    961961    }
     
    10461046    if (fread((void *) &biggiestruct, 1, sizeof(biggiestruct), fin) <
    10471047        sizeof(biggiestruct)) {
    1048         log_msg(2, "Warning - unable to get biggiestruct of bigfile #%d",
     1048        mr_msg(2, "Warning - unable to get biggiestruct of bigfile #%d",
    10491049                bigfileno + 1);
    10501050    }
     
    10561056        sprintf(tmp, "Warning - bigfile %ld does not have a checksum",
    10571057                bigfileno + 1);
    1058         log_msg(3, tmp);
     1058        mr_msg(3, tmp);
    10591059        p = checksum;
    10601060    }
     
    10721072        node = find_string_at_node(filelist, biggiestruct.filename);
    10731073        if (!node) {
    1074             log_msg(0, "Skipping %s (name isn't in filelist)",
     1074            mr_msg(0, "Skipping %s (name isn't in filelist)",
    10751075                    biggiestruct.filename);
    10761076            pathname_of_last_file_restored[0] = '\0';
    10771077            return (0);
    10781078        } else if (!(node->selected)) {
    1079             log_msg(1, "Skipping %s (name isn't in biggielist subset)",
     1079            mr_msg(1, "Skipping %s (name isn't in biggielist subset)",
    10801080                    biggiestruct.filename);
    10811081            pathname_of_last_file_restored[0] = '\0';
     
    10851085    /* otherwise, continue */
    10861086
    1087     log_msg(1, "DEFINITELY restoring %s", biggiestruct.filename);
     1087    mr_msg(1, "DEFINITELY restoring %s", biggiestruct.filename);
    10881088    if (biggiestruct.use_ntfsprog) {
    10891089        if (strncmp(biggiestruct.filename, "/dev/", 5)) {
    1090             log_msg(1,
     1090            mr_msg(1,
    10911091                    "I was in error when I set biggiestruct.use_ntfsprog to TRUE.");
    1092             log_msg(1, "%s isn't even in /dev", biggiestruct.filename);
     1092            mr_msg(1, "%s isn't even in /dev", biggiestruct.filename);
    10931093            biggiestruct.use_ntfsprog = FALSE;
    10941094        }
     
    11001100        g_loglevel = 4;
    11011101        use_ntfsprog_hack = TRUE;
    1102         log_msg(2,
     1102        mr_msg(2,
    11031103                "Calling ntfsclone in background because %s is an NTFS /dev entry",
    11041104                outfile_fname);
     
    11121112            fatal_error("Fork failure");
    11131113        case 0:
    1114             log_msg(3,
     1114            mr_msg(3,
    11151115                    "CHILD - fip - calling feed_outfrom_ntfsprog(%s, %s)",
    11161116                    biggiestruct.filename, ntfsprog_fifo);
     
    11181118                feed_outfrom_ntfsprog(biggiestruct.filename,
    11191119                                       ntfsprog_fifo);
    1120 //          log_msg(3, "CHILD - fip - exiting");
     1120//          mr_msg(3, "CHILD - fip - exiting");
    11211121            exit(res);
    11221122            break;
    11231123        default:
    1124             log_msg(3,
     1124            mr_msg(3,
    11251125                    "feed_into_ntfsprog() called in background --- pid=%ld",
    11261126                    (long int) (pid));
     
    11381138    sprintf(tmp, "Reassembling big file %ld (%s)", bigfileno + 1,
    11391139            outfile_fname);
    1140     log_msg(2, tmp);
     1140    mr_msg(2, tmp);
    11411141
    11421142    /*
     
    11501150    pathname_of_last_file_restored[MAX_STR_LEN - 1] = '\0';
    11511151
    1152     log_msg(3, "file_to_openout = %s", file_to_openout);
     1152    mr_msg(3, "file_to_openout = %s", file_to_openout);
    11531153    if (!(fout = fopen(file_to_openout, "w"))) {
    11541154        log_to_screen("Cannot openout outfile_fname - hard disk full?");
    11551155        return (1);
    11561156    }
    1157     log_msg(3, "Opened out to %s", outfile_fname);  // CD/DVD --> mondorestore --> ntfsclone --> hard disk itself
     1157    mr_msg(3, "Opened out to %s", outfile_fname);   // CD/DVD --> mondorestore --> ntfsclone --> hard disk itself
    11581158
    11591159    for (sliceno = 1, finished = FALSE; !finished;) {
     
    11691169            !does_file_exist(slice_fname
    11701170                             (bigfileno, sliceno, ARCHIVES_PATH, "bz2"))) {
    1171             log_msg(3,
     1171            mr_msg(3,
    11721172                    "Cannot find a data slice or terminator slice on CD %d",
    11731173                    g_current_media_number);
     
    11771177                    media_descriptor_string(bkpinfo->backup_media_type),
    11781178                    g_current_media_number, sliceno);
    1179             log_msg(2, tmp);
     1179            mr_msg(2, tmp);
    11801180            sprintf(tmp, "Restoring from %s #%d",
    11811181                    media_descriptor_string(bkpinfo->backup_media_type),
     
    11881188                   slice_fname(bigfileno, sliceno, ARCHIVES_PATH, ""));
    11891189            if (does_file_exist(tmp) && length_of_file(tmp) == 0) {
    1190                 log_msg(2,
     1190                mr_msg(2,
    11911191                        "End of bigfile # %ld (slice %ld is the terminator)",
    11921192                        bigfileno + 1, sliceno);
     
    12351235                    media_descriptor_string(bkpinfo->backup_media_type),
    12361236                    g_current_media_number, bigfileno + 1, sliceno);
    1237             log_msg(2, tmp);
     1237            mr_msg(2, tmp);
    12381238
    12391239            if (!g_text_mode) {
     
    12531253                    sprintf(sz_msg + strlen(sz_msg),
    12541254                            "; written %ld to fout", siz);
    1255 //        log_msg(2. sz_msg);
     1255//        mr_msg(2. sz_msg);
    12561256                }
    12571257            }
     
    12741274
    12751275    if (use_ntfsprog_hack) {
    1276         log_msg(3, "Waiting for ntfsclone to finish");
     1276        mr_msg(3, "Waiting for ntfsclone to finish");
    12771277        sprintf(tmp,
    12781278                " ps | grep \" ntfsclone \" | grep -v grep > /dev/null 2> /dev/null");
     
    13701370    if (use_ntfsprog == BLK_START_A_PIHBIGGIE) {
    13711371        use_ntfsprog = 1;
    1372         log_msg(1, "%s --- pih=YES", orig_bf_fname);
     1372        mr_msg(1, "%s --- pih=YES", orig_bf_fname);
    13731373    } else if (use_ntfsprog == BLK_START_A_NORMBIGGIE) {
    13741374        use_ntfsprog = 0;
    1375         log_msg(1, "%s --- pih=NO", orig_bf_fname);
     1375        mr_msg(1, "%s --- pih=NO", orig_bf_fname);
    13761376    } else {
    13771377        use_ntfsprog = 0;
    1378         log_msg(1, "%s --- pih=NO (weird marker though)", orig_bf_fname);
     1378        mr_msg(1, "%s --- pih=NO (weird marker though)", orig_bf_fname);
    13791379    }
    13801380
     
    13891389        if (!node) {
    13901390            dummy_restore = TRUE;
    1391             log_msg(1,
     1391            mr_msg(1,
    13921392                    "Skipping big file %ld (%s) - not in biggielist subset",
    13931393                    biggiefile_number + 1, orig_bf_fname);
     
    13951395        } else if (!(node->selected)) {
    13961396            dummy_restore = TRUE;
    1397             log_msg(1, "Skipping %s (name isn't in biggielist subset)",
     1397            mr_msg(1, "Skipping %s (name isn't in biggielist subset)",
    13981398                    orig_bf_fname);
    13991399            pathname_of_last_file_restored[0] = '\0';
     
    14031403    if (use_ntfsprog) {
    14041404        if (strncmp(orig_bf_fname, "/dev/", 5)) {
    1405             log_msg(1,
     1405            mr_msg(1,
    14061406                    "I was in error when I set use_ntfsprog to TRUE.");
    1407             log_msg(1, "%s isn't even in /dev", orig_bf_fname);
     1407            mr_msg(1, "%s isn't even in /dev", orig_bf_fname);
    14081408            use_ntfsprog = FALSE;
    14091409        }
     
    14141414        strcpy(outfile_fname, orig_bf_fname);
    14151415        use_ntfsprog_hack = TRUE;
    1416         log_msg(2,
     1416        mr_msg(2,
    14171417                "Calling ntfsclone in background because %s is a /dev entry",
    14181418                outfile_fname);
     
    14281428            fatal_error("Fork failure");
    14291429        case 0:
    1430             log_msg(3,
     1430            mr_msg(3,
    14311431                    "CHILD - fip - calling feed_outfrom_ntfsprog(%s, %s)",
    14321432                    outfile_fname, ntfsprog_fifo);
    14331433            res =
    14341434                feed_outfrom_ntfsprog(outfile_fname, ntfsprog_fifo);
    1435 //          log_msg(3, "CHILD - fip - exiting");
     1435//          mr_msg(3, "CHILD - fip - exiting");
    14361436            exit(res);
    14371437            break;
    14381438        default:
    1439             log_msg(3,
     1439            mr_msg(3,
    14401440                    "feed_into_ntfsprog() called in background --- pid=%ld",
    14411441                    (long int) (pid));
     
    14591459        sprintf(tmp, "Reassembling big file %ld (%s)",
    14601460                biggiefile_number + 1, orig_bf_fname);
    1461         log_msg(2, tmp);
     1461        mr_msg(2, tmp);
    14621462    }
    14631463
     
    14731473    }
    14741474    sprintf(tmp, "Pipe command = '%s'", command);
    1475     log_msg(3, tmp);
     1475    mr_msg(3, tmp);
    14761476
    14771477    /* restore biggiefile, one slice at a time */
     
    14871487        sprintf(tmp, "Working on file #%ld, slice #%ld    ",
    14881488                biggiefile_number + 1, current_slice_number);
    1489         log_msg(2, tmp);
     1489        mr_msg(2, tmp);
    14901490        if (!g_text_mode) {
    14911491            newtDrawRootText(0, g_noof_rows - 2, tmp);
     
    15051505                    ((void *) &biggiestruct, 1, sizeof(biggiestruct),
    15061506                     fin) < sizeof(biggiestruct)) {
    1507                     log_msg(2,
     1507                    mr_msg(2,
    15081508                            "Warning - unable to get biggiestruct of bigfile #%d",
    15091509                            biggiefile_number + 1);
     
    15251525    paranoid_pclose(pout);
    15261526
    1527     log_msg(1, "pathname_of_last_file_restored is now %s",
     1527    mr_msg(1, "pathname_of_last_file_restored is now %s",
    15281528            pathname_of_last_file_restored);
    15291529
    15301530    if (use_ntfsprog_hack) {
    1531         log_msg(3, "Waiting for ntfsclone to finish");
     1531        mr_msg(3, "Waiting for ntfsclone to finish");
    15321532        sprintf(tmp,
    15331533                " ps | grep \" ntfsclone \" | grep -v grep > /dev/null 2> /dev/null");
     
    15351535            sleep(1);
    15361536        }
    1537         log_msg(3, "OK, ntfsclone has really finished");
    1538     }
    1539 
    1540     log_msg(3, "biggiestruct.filename = %s", biggiestruct.filename);
    1541     log_msg(3, "biggiestruct.checksum = %s", biggiestruct.checksum);
     1537        mr_msg(3, "OK, ntfsclone has really finished");
     1538    }
     1539
     1540    mr_msg(3, "biggiestruct.filename = %s", biggiestruct.filename);
     1541    mr_msg(3, "biggiestruct.checksum = %s", biggiestruct.checksum);
    15421542    if (strcmp(outfile_fname, "/dev/null")) {
    15431543        chmod(outfile_fname, biggiestruct.properties.st_mode);
     
    16091609    malloc_string(acl_fname);
    16101610
    1611     log_msg(5, "Entering");
     1611    mr_msg(5, "Entering");
    16121612    filelist_subset_fname[0] = '\0';
    16131613    use_star = (strstr(tarball_fname, ".star")) ? TRUE : FALSE;
     
    16211621            current_tarball_number);
    16221622    if (length_of_file(filelist_name) <= 2) {
    1623         log_msg(2, "There are _zero_ files in filelist '%s'",
     1623        mr_msg(2, "There are _zero_ files in filelist '%s'",
    16241624                filelist_name);
    1625         log_msg(2,
     1625        mr_msg(2,
    16261626                "This is a bit silly (ask dev-team to fix mondo_makefilelist, please)");
    1627         log_msg(2,
     1627        mr_msg(2,
    16281628                "but it's non-critical. It's cosmetic. Don't worry about it.");
    16291629        retval = 0;
     
    16321632    if (count_lines_in_file(filelist_name) <= 0
    16331633        || length_of_file(tarball_fname) <= 0) {
    1634         log_msg(3, "length_of_file(%s) = %llu", tarball_fname,
     1634        mr_msg(3, "length_of_file(%s) = %llu", tarball_fname,
    16351635                length_of_file(tarball_fname));
    16361636        sprintf(tmp, "Unable to restore fileset #%ld (CD I/O error)",
     
    16501650            <= 0) {
    16511651            sprintf(tmp, "Skipping fileset %ld", current_tarball_number);
    1652             log_msg(1, tmp);
     1652            mr_msg(1, tmp);
    16531653        } else {
    1654             log_msg(3, "Saved fileset %ld's subset to %s",
     1654            mr_msg(3, "Saved fileset %ld's subset to %s",
    16551655                    current_tarball_number, filelist_subset_fname);
    16561656        }
     
    17221722        sprintf(command + strlen(command), " 2>> %s >> %s", temp_log,
    17231723                temp_log);
    1724         log_msg(1, "command = '%s'", command);
     1724        mr_msg(1, "command = '%s'", command);
    17251725        unlink(temp_log);
    17261726        res = system(command);
     
    17291729            if (p) {
    17301730                p[0] = p[1] = p[2] = p[3] = ' ';
    1731                 log_msg(1, "new command = '%s'", command);
     1731                mr_msg(1, "new command = '%s'", command);
    17321732                res = system(command);
    17331733            }
     
    17381738
    17391739        if (g_getfattr) {
    1740             log_msg(1, "Setting fattr list %s", xattr_fname);
     1740            mr_msg(1, "Setting fattr list %s", xattr_fname);
    17411741            if (length_of_file(xattr_fname) > 0) {
    17421742                res = set_fattr_list(filelist_subset_fname, xattr_fname);
     
    17451745                        ("Errors occurred while setting extended attributes");
    17461746                } else {
    1747                     log_msg(1, "I set xattr OK");
     1747                    mr_msg(1, "I set xattr OK");
    17481748                }
    17491749                retval += res;
     
    17511751        }
    17521752        if (g_getfacl) {
    1753             log_msg(1, "Setting acl list %s", acl_fname);
     1753            mr_msg(1, "Setting acl list %s", acl_fname);
    17541754            if (length_of_file(acl_fname) > 0) {
    17551755                res = set_acl_list(filelist_subset_fname, acl_fname);
     
    17581758                        ("Errors occurred while setting access control lists");
    17591759                } else {
    1760                     log_msg(1, "I set ACL OK");
     1760                    mr_msg(1, "I set ACL OK");
    17611761                }
    17621762                retval += res;
     
    17661766            sprintf(command, "cat %s >> %s", temp_log, MONDO_LOGFILE);
    17671767            system(command);
    1768             log_msg(2, "Errors occurred while processing fileset #%d",
     1768            mr_msg(2, "Errors occurred while processing fileset #%d",
    17691769                    current_tarball_number);
    17701770        } else {
    1771             log_msg(2, "Fileset #%d processed OK", current_tarball_number);
     1771            mr_msg(2, "Fileset #%d processed OK", current_tarball_number);
    17721772        }
    17731773    }
     
    17901790    mr_free(xattr_fname);
    17911791    mr_free(acl_fname);
    1792     log_msg(5, "Leaving");
     1792    mr_msg(5, "Leaving");
    17931793    return (retval);
    17941794}
     
    18521852            media_descriptor_string(bkpinfo->backup_media_type),
    18531853            g_current_media_number);
    1854     log_msg(2, tmp);
     1854    mr_msg(2, tmp);
    18551855    run_program_and_log_output("mkdir -p " MNT_RESTORING "/tmp", FALSE);
    18561856
     
    18731873    }
    18741874    if (res) {
    1875         log_msg(1, "Warning - error reading afioball from tape");
     1875        mr_msg(1, "Warning - error reading afioball from tape");
    18761876    }
    18771877    if (bkpinfo->compression_level == 0) {
     
    19001900        sprintf(command + strlen(command), " > %s 2>> %s", filelist_fname,
    19011901                MONDO_LOGFILE);
    1902         log_msg(1, "command = %s", command);
     1902        mr_msg(1, "command = %s", command);
    19031903        if (system(command)) {
    1904             log_msg(4, "Warning - error occurred while retrieving TOC");
     1904            mr_msg(4, "Warning - error occurred while retrieving TOC");
    19051905        }
    19061906        if ((matches =
     
    19101910            <= 0 || length_of_file(filelist_subset_fname) < 2) {
    19111911            if (length_of_file(filelist_subset_fname) < 2) {
    1912                 log_msg(1, "No matches found in fileset %ld",
     1912                mr_msg(1, "No matches found in fileset %ld",
    19131913                        current_tarball_number);
    19141914            }
    19151915            sprintf(tmp, "Skipping fileset %ld", current_tarball_number);
    1916             log_msg(2, tmp);
     1916            mr_msg(2, tmp);
    19171917            restore_this_fileset = FALSE;
    19181918        } else {
    1919             log_msg(5, "%ld matches. Saved fileset %ld's subset to %s",
     1919            mr_msg(5, "%ld matches. Saved fileset %ld's subset to %s",
    19201920                    matches, current_tarball_number,
    19211921                    filelist_subset_fname);
     
    19461946// Call if IF there are files to restore (selectively/unconditionally)
    19471947    if (restore_this_fileset) {
    1948         log_msg(1, "Calling command='%s'", command);
     1948        mr_msg(1, "Calling command='%s'", command);
    19491949        paranoid_system(command);
    19501950
     
    19531953            res = set_fattr_list(filelist_subset_fname, xattr_fname);
    19541954            if (res) {
    1955                 log_msg(1, "Errors occurred while setting xattr");
     1955                mr_msg(1, "Errors occurred while setting xattr");
    19561956            } else {
    1957                 log_msg(1, "I set xattr OK");
     1957                mr_msg(1, "I set xattr OK");
    19581958            }
    19591959            retval += res;
     
    19641964            res = set_acl_list(filelist_subset_fname, acl_fname);
    19651965            if (res) {
    1966                 log_msg(1, "Errors occurred while setting ACL");
     1966                mr_msg(1, "Errors occurred while setting ACL");
    19671967            } else {
    1968                 log_msg(1, "I set ACL OK");
     1968                mr_msg(1, "I set ACL OK");
    19691969            }
    19701970            retval += res;
     
    19721972
    19731973    } else {
    1974         log_msg(1, "NOT CALLING '%s'", command);
     1974        mr_msg(1, "NOT CALLING '%s'", command);
    19751975    }
    19761976
     
    20342034            "%s/biggies-whose-EXATs-we-should-set", bkpinfo->tmpdir);
    20352035    if (!(fbw = fopen(biggies_whose_EXATs_we_should_set, "w"))) {
    2036         log_msg(1, "Warning - cannot openout %s",
     2036        mr_msg(1, "Warning - cannot openout %s",
    20372037                biggies_whose_EXATs_we_should_set);
    20382038    }
     
    20432043    mvaddstr_and_log_it(g_currentY, 0, tmp);
    20442044    if (length_of_file(BIGGIELIST) < 6) {
    2045         log_msg(1, "OK, no biggielist; not restoring biggiefiles");
     2045        mr_msg(1, "OK, no biggielist; not restoring biggiefiles");
    20462046        return (0);
    20472047    }
    20482048    noof_biggiefiles = count_lines_in_file(BIGGIELIST);
    20492049    if (noof_biggiefiles <= 0) {
    2050         log_msg(2,
     2050        mr_msg(2,
    20512051                "OK, no biggiefiles in biggielist; not restoring biggiefiles");
    20522052        return (0);
     
    20542054    sprintf(tmp, "OK, there are %ld biggiefiles in the archives",
    20552055            noof_biggiefiles);
    2056     log_msg(2, tmp);
     2056    mr_msg(2, tmp);
    20572057
    20582058    open_progress_form("Reassembling large files",
     
    20612061                       "", total_slices);
    20622062    for (bigfileno = 0, finished = FALSE; !finished;) {
    2063         log_msg(2, "Thinking about restoring bigfile %ld", bigfileno + 1);
     2063        mr_msg(2, "Thinking about restoring bigfile %ld", bigfileno + 1);
    20642064        if (!does_file_exist(slice_fname(bigfileno, 0, ARCHIVES_PATH, ""))) {
    2065             log_msg(3,
     2065            mr_msg(3,
    20662066                    "...but its first slice isn't on this CD. Perhaps this was a selective restore?");
    2067             log_msg(3, "Cannot find bigfile #%ld 's first slice on %s #%d",
     2067            mr_msg(3, "Cannot find bigfile #%ld 's first slice on %s #%d",
    20682068                    bigfileno + 1,
    20692069                    media_descriptor_string(bkpinfo->backup_media_type),
    20702070                    g_current_media_number);
    2071             log_msg(3, "Slicename would have been %s",
     2071            mr_msg(3, "Slicename would have been %s",
    20722072                    slice_fname(bigfileno + 1, 0, ARCHIVES_PATH, ""));
    20732073            // I'm not positive 'just_changed_cds' is even necessary...
    20742074            if (just_changed_cds) {
    20752075                just_changed_cds = FALSE;
    2076                 log_msg(3,
     2076                mr_msg(3,
    20772077                        "I'll continue to scan this CD for bigfiles to be restored.");
    20782078            } else if (does_file_exist(MNT_CDROM "/archives/NOT-THE-LAST")) {
     
    20862086                just_changed_cds = TRUE;
    20872087            } else {
    2088                 log_msg(2, "There was no bigfile #%ld. That's OK.",
     2088                mr_msg(2, "There was no bigfile #%ld. That's OK.",
    20892089                        bigfileno + 1);
    2090                 log_msg(2, "I'm going to stop restoring bigfiles now.");
     2090                mr_msg(2, "I'm going to stop restoring bigfiles now.");
    20912091                finished = TRUE;
    20922092            }
     
    21802180
    21812181    mvaddstr_and_log_it(g_currentY, 0, "Restoring from archives");
    2182     log_msg(2,
     2182    mr_msg(2,
    21832183            "Insisting on 1st CD, so that I can have a look at LAST-FILELIST-NUMBER");
    21842184    if (g_current_media_number != 1) {
    2185         log_msg(3, "OK, that's jacked up.");
     2185        mr_msg(3, "OK, that's jacked up.");
    21862186        g_current_media_number = 1;
    21872187    }
     
    22442244                    media_descriptor_string(bkpinfo->backup_media_type),
    22452245                    g_current_media_number);
    2246 //    log_msg(3, "progress_str = %s", progress_str);
     2246//    mr_msg(3, "progress_str = %s", progress_str);
    22472247            for (res = 999, attempts = 0; attempts < 3 && res != 0;
    22482248                 attempts++) {
     
    23502350            "%s/biggies-whose-EXATs-we-should-set", bkpinfo->tmpdir);
    23512351    if (!(fbw = fopen(biggies_whose_EXATs_we_should_set, "w"))) {
    2352         log_msg(1, "Warning - cannot openout %s",
     2352        mr_msg(1, "Warning - cannot openout %s",
    23532353                biggies_whose_EXATs_we_should_set);
    23542354    }
     
    23662366    sprintf(tmp, "OK, there are %ld biggiefiles in the archives",
    23672367            noof_biggiefiles);
    2368     log_msg(2, tmp);
     2368    mr_msg(2, tmp);
    23692369    open_progress_form("Reassembling large files",
    23702370                       "I am now reassembling all the large files.",
     
    23982398                                               filelist, ctrl_chr,
    23992399                                               pathname_of_last_biggie_restored);
    2400         log_msg(1, "I believe I have restored %s",
     2400        mr_msg(1, "I believe I have restored %s",
    24012401                pathname_of_last_biggie_restored);
    24022402        if (fbw && pathname_of_last_biggie_restored[0]) {
     
    24162416                noof_biggiefiles, current_bigfile_number);
    24172417    }
    2418     log_msg(1, tmp);
     2418    mr_msg(1, tmp);
    24192419
    24202420    if (fbw) {
     
    24242424            if (g_getfattr) {
    24252425                if (length_of_file(xattr_fname) > 0) {
    2426                     log_msg(1, "set_fattr_List(%s,%s)",
     2426                    mr_msg(1, "set_fattr_List(%s,%s)",
    24272427                        biggies_whose_EXATs_we_should_set, xattr_fname);
    24282428                    set_fattr_list(biggies_whose_EXATs_we_should_set,
     
    24322432            if (g_getfacl) {
    24332433                if (length_of_file(acl_fname) > 0) {
    2434                     log_msg(1, "set_acl_list(%s,%s)",
     2434                    mr_msg(1, "set_acl_list(%s,%s)",
    24352435                            biggies_whose_EXATs_we_should_set, acl_fname);
    24362436                    set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname);
     
    25232523                       progress_str, max_val);
    25242524
    2525     log_msg(3, "hey");
     2525    mr_msg(3, "hey");
    25262526
    25272527    res = read_header_block_from_stream(&tmp_size, tmp_fname, &ctrl_chr);
    25282528    if (res) {
    2529         log_msg(2, "Warning - error reading afioball from tape");
     2529        mr_msg(2, "Warning - error reading afioball from tape");
    25302530    }
    25312531    retval += res;
     
    25332533        wrong_marker(BLK_START_AFIOBALLS, ctrl_chr);
    25342534    }
    2535     log_msg(2, "ho");
     2535    mr_msg(2, "ho");
    25362536    res = read_header_block_from_stream(&tmp_size, tmp_fname, &ctrl_chr);
    25372537    while (ctrl_chr != BLK_STOP_AFIOBALLS) {
     
    25922592        }
    25932593    }                           // next
    2594     log_msg(1, "All done with afioballs");
     2594    mr_msg(1, "All done with afioballs");
    25952595    close_progress_form();
    25962596    if (retval) {
     
    26362636    malloc_string(newpath);
    26372637    malloc_string(tmp);
    2638     log_msg(2, "restore_everything() --- starting");
     2638    mr_msg(2, "restore_everything() --- starting");
    26392639    g_current_media_number = 1;
    26402640    getcwd(cwd, MAX_STR_LEN - 1);
    26412641    sprintf(tmp, "mkdir -p %s", bkpinfo->restore_path);
    26422642    run_program_and_log_output(tmp, FALSE);
    2643     log_msg(1, "Changing dir to %s", bkpinfo->restore_path);
     2643    mr_msg(1, "Changing dir to %s", bkpinfo->restore_path);
    26442644    chdir(bkpinfo->restore_path);
    26452645    getcwd(newpath, MAX_STR_LEN - 1);
    2646     log_msg(1, "path is now %s", newpath);
    2647     log_msg(1, "restoring everything");
     2646    mr_msg(1, "path is now %s", newpath);
     2647    mr_msg(1, "restoring everything");
    26482648    if (!find_home_of_exe("petris") && !g_text_mode) {
    26492649        newtDrawRootText(0, g_noof_rows - 2,
     
    26822682    }
    26832683    if (length_of_file("/etc/raidtab") > 0) {
    2684         log_msg(2, "Copying local raidtab to restored filesystem");
     2684        mr_msg(2, "Copying local raidtab to restored filesystem");
    26852685        run_program_and_log_output("cp -f /etc/raidtab " MNT_RESTORING
    26862686                                   "/etc/raidtab", FALSE);
    26872687    }
    26882688    kill_petris();
    2689     log_msg(2, "restore_everything() --- leaving");
     2689    mr_msg(2, "restore_everything() --- leaving");
    26902690    mr_free(cwd);
    26912691    mr_free(newpath);
     
    27322732    sprintf(tmp, "restore_here = '%s'", restore_here);
    27332733
    2734     log_msg(2, tmp);
    2735 
    2736     log_msg(2, "restore_live_from_monitas_server() - starting");
     2734    mr_msg(2, tmp);
     2735
     2736    mr_msg(2, "restore_live_from_monitas_server() - starting");
    27372737    unlink("/tmp/mountlist.txt");
    27382738    unlink("/tmp/filelist.full");
     
    27432743        strcpy(bkpinfo->restore_path, restore_here);
    27442744    }
    2745     log_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");
     2745    mr_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");
    27462746    sprintf(tmp, "FYI - data will be restored to %s",
    27472747            bkpinfo->restore_path);
    2748     log_msg(3, tmp);
    2749     log_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");
     2748    mr_msg(3, tmp);
     2749    mr_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");
    27502750    sprintf(datadisks_fname, "/tmp/mondorestore.datadisks.%d",
    27512751            (int) (random() % 32768));
     
    27982798            restore_this_directory, g_biggielist_txt, g_biggielist_txt);
    27992799    if (system(command)) {
    2800         log_msg(1,
     2800        mr_msg(1,
    28012801                "Error(s) occurred while processing biggielist and wildcard");
    28022802    }
     
    28062806    retval += restore_everything(bkpinfo, filelist);
    28072807    free_filelist(filelist);
    2808     log_msg(2, "--------End of restore_live_from_monitas_server--------");
     2808    mr_msg(2, "--------End of restore_live_from_monitas_server--------");
    28092809    return (retval);
    28102810}
     
    28282828void welcome_to_mondorestore()
    28292829{
    2830     log_msg(0, "-------------- Mondo Restore v%s -------------", PACKAGE_VERSION);
    2831     log_msg(0,
     2830    mr_msg(0, "-------------- Mondo Restore v%s -------------", PACKAGE_VERSION);
     2831    mr_msg(0,
    28322832            "DON'T PANIC! Mondorestore logs almost everything, so please ");
    2833     log_msg(0,
     2833    mr_msg(0,
    28342834            "don't break out in a cold sweat just because you see a few  ");
    2835     log_msg(0,
     2835    mr_msg(0,
    28362836            "error messages in the log. Read them; analyze them; see if  ");
    2837     log_msg(0,
     2837    mr_msg(0,
    28382838            "they are significant; above all, verify your backups! Please");
    2839     log_msg(0,
     2839    mr_msg(0,
    28402840            "attach a compressed copy of this log to any e-mail you send ");
    2841     log_msg(0,
     2841    mr_msg(0,
    28422842            "to the Mondo mailing list when you are seeking technical    ");
    2843     log_msg(0,
     2843    mr_msg(0,
    28442844            "support. Without it, we can't help you.            - DevTeam");
    2845     log_msg(0,
     2845    mr_msg(0,
    28462846            "------------------------------------------------------------");
    2847     log_msg(0,
     2847    mr_msg(0,
    28482848            "BTW, despite (or perhaps because of) the wealth of messages,");
    2849     log_msg(0,
     2849    mr_msg(0,
    28502850            "some users are inclined to stop reading this log.  If Mondo ");
    2851     log_msg(0,
     2851    mr_msg(0,
    28522852            "stopped for some reason, chances are it's detailed here.    ");
    2853     log_msg(0,
     2853    mr_msg(0,
    28542854            "More than likely there's a message at the very end of this  ");
    2855     log_msg(0,
     2855    mr_msg(0,
    28562856            "log that will tell you what is wrong.  Please read it!      ");
    2857     log_msg(0,
     2857    mr_msg(0,
    28582858            "------------------------------------------------------------");
    28592859}
     
    29062906    {
    29072907        g_text_mode = TRUE;
    2908         log_msg(1, "TEXTONLY MODE");
     2908        mr_msg(1, "TEXTONLY MODE");
    29092909    } else {
    29102910        g_text_mode = FALSE;
     
    29412941    g_kernel_version = get_kernel_version();
    29422942
    2943     log_msg(1, "FYI - g_mountlist_fname = %s", g_mountlist_fname);
     2943    mr_msg(1, "FYI - g_mountlist_fname = %s", g_mountlist_fname);
    29442944    if (strlen(g_mountlist_fname) < 3) {
    29452945        fatal_error
     
    29512951    sprintf(tmp, "%s.orig", g_mountlist_fname);
    29522952    if (!does_file_exist(g_mountlist_fname)) {
    2953         log_msg(2,
     2953        mr_msg(2,
    29542954                "%ld: Warning - g_mountlist_fname (%s) does not exist yet",
    29552955                __LINE__, g_mountlist_fname);
     
    29782978    welcome_to_mondorestore();
    29792979    if (bkpinfo->disaster_recovery) {
    2980         log_msg(1, "I am in disaster recovery mode");
     2980        mr_msg(1, "I am in disaster recovery mode");
    29812981    } else {
    2982         log_msg(1, "I am in normal, live mode");
     2982        mr_msg(1, "I am in normal, live mode");
    29832983    }
    29842984
     
    30613061
    30623062    if (argc == 5 && strcmp(argv[1], "--copy") == 0) {
    3063         log_msg(1, "SCORE");
     3063        mr_msg(1, "SCORE");
    30643064        g_loglevel = 10;
    30653065        if (strstr(argv[2], "save")) {
    3066             log_msg(1, "Saving from %s to %s", argv[3], argv[4]);
     3066            mr_msg(1, "Saving from %s to %s", argv[3], argv[4]);
    30673067            fin = fopen(argv[3], "r");
    30683068            fout = fopen(argv[4], "w");
     
    31163116//    return(1);
    31173117        }
    3118         log_msg(1, "I am in normal, live mode.");
    3119         log_msg(2, "FYI, MOUNTLIST_FNAME = %s", g_mountlist_fname);
     3118        mr_msg(1, "I am in normal, live mode.");
     3119        mr_msg(2, "FYI, MOUNTLIST_FNAME = %s", g_mountlist_fname);
    31203120        mount_boot_if_necessary();  /* for Gentoo users */
    3121         log_msg(2, "Still here.");
     3121        mr_msg(2, "Still here.");
    31223122        if (argc > 1 && strcmp(argv[argc - 1], "--live-from-cd") == 0) {
    31233123            g_restoring_live_from_cd = TRUE;
     
    31293129                                                 argv[3], argv[4]);
    31303130        } else {
    3131             log_msg(2, "Calling restore_to_live_filesystem()");
     3131            mr_msg(2, "Calling restore_to_live_filesystem()");
    31323132            retval = restore_to_live_filesystem(bkpinfo);
    31333133        }
    3134         log_msg(2, "Still here. Yay.");
     3134        mr_msg(2, "Still here. Yay.");
    31353135        if (strlen(bkpinfo->tmpdir) > 0) {
    31363136            sprintf(tmp, "rm -Rf %s/*", bkpinfo->tmpdir);
     
    31413141    } else {
    31423142        /* Disaster recovery mode (must be) */
    3143         log_msg(1, "I must be in disaster recovery mode.");
    3144         log_msg(2, "FYI, MOUNTLIST_FNAME = %s ", g_mountlist_fname);
     3143        mr_msg(1, "I must be in disaster recovery mode.");
     3144        mr_msg(2, "FYI, MOUNTLIST_FNAME = %s ", g_mountlist_fname);
    31453145        if (argc == 3 && strcmp(argv[1], "--monitas-memorex") == 0) {
    31463146            log_to_screen("Uh, that hasn't been implemented yet.");
     
    31613161            if (bkpinfo->backup_media_type == nfs
    31623162                && !is_this_device_mounted(bkpinfo->nfs_mount)) {
    3163                 log_msg(1, "Mounting nfs dir");
     3163                mr_msg(1, "Mounting nfs dir");
    31643164                sprintf(bkpinfo->isodir, "/tmp/isodir");
    31653165                run_program_and_log_output("mkdir -p /tmp/isodir", 5);
     
    31773177
    31783178
    3179         log_msg(1, "Send in the clowns.");
     3179        mr_msg(1, "Send in the clowns.");
    31803180
    31813181        if (argc == 2 && strcmp(argv[1], "--partition-only") == 0) {
    3182             log_msg(0, "Partitioning only.");
     3182            mr_msg(0, "Partitioning only.");
    31833183            load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
    31843184            strcpy(g_mountlist_fname, "/tmp/mountlist.txt");
     
    31893189
    31903190        if (argc == 2 && strcmp(argv[1], "--format-only") == 0) {
    3191             log_msg(0, "Formatting only.");
     3191            mr_msg(0, "Formatting only.");
    31923192            load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
    31933193            strcpy(g_mountlist_fname, "/tmp/mountlist.txt");
     
    31983198
    31993199        if (argc == 2 && strcmp(argv[1], "--stop-lvm-and-raid") == 0) {
    3200             log_msg(0, "Stopping LVM and RAID");
     3200            mr_msg(0, "Stopping LVM and RAID");
    32013201            load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
    32023202            strcpy(g_mountlist_fname, "/tmp/mountlist.txt");
     
    32813281// g_I_have_just_nuked is set true by nuke_mode() just before it returns
    32823282    if (!system("which post-nuke > /dev/null 2> /dev/null")) {
    3283       log_msg(1, "post-nuke found; find out whether we should run it...");
     3283      mr_msg(1, "post-nuke found; find out whether we should run it...");
    32843284      if (g_I_have_just_nuked || does_file_exist("/POST-NUKE-ANYWAY")) {
    32853285        run_postnuke = TRUE;
    3286         log_msg(1, "Yes, will run post-nuke because in nuke mode or file /POST-NUKE-ANYWAY exists.");
     3286        mr_msg(1, "Yes, will run post-nuke because in nuke mode or file /POST-NUKE-ANYWAY exists.");
    32873287      } else if (ask_me_yes_or_no("post-nuke script found. Do you want to run it?")) {
    32883288        run_postnuke = TRUE;
    3289         log_msg(1, "Yes, will run post-nuke because user interactively asked for it.");
     3289        mr_msg(1, "Yes, will run post-nuke because user interactively asked for it.");
    32903290      } else {
    32913291        run_postnuke = FALSE;
    3292         log_msg(1, "No, will not run post-nuke.");
     3292        mr_msg(1, "No, will not run post-nuke.");
    32933293      }
    32943294    } else {
    3295       log_msg(1, "No post-nuke found.");
     3295      mr_msg(1, "No post-nuke found.");
    32963296    }
    32973297    if (run_postnuke) {
     
    33013301          ("Unable to re-mount partitions for post-nuke stuff");
    33023302      } else {
    3303         log_msg(1, "Re-mounted partitions for post-nuke stuff");
     3303        mr_msg(1, "Re-mounted partitions for post-nuke stuff");
    33043304        sprintf(tmp, "post-nuke %s %d", bkpinfo->restore_path,
    33053305            retval);
    3306         log_msg(2, "Calling '%s'", tmp);
     3306        mr_msg(2, "Calling '%s'", tmp);
    33073307        if ((res = run_program_and_log_output(tmp, 0))) {
    33083308          log_OS_error(tmp);
    33093309        }
    3310         log_msg(1, "post-nuke returned w/ res=%d", res);
     3310        mr_msg(1, "post-nuke returned w/ res=%d", res);
    33113311      }
    33123312      unmount_all_devices(mountlist);
Note: See TracChangeset for help on using the changeset viewer.