Ignore:
Timestamp:
Feb 2, 2007, 11:21:27 PM (13 years ago)
Author:
Bruno Cornec
Message:

log_msg => mr_msg in trunk

File:
1 edited

Legend:

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

    r1081 r1086  
    155155    int retval = 0, res = 0;
    156156
    157     log_msg(2, "let_user_edit_the_mountlist() --- starting");
     157    mr_msg(2, "let_user_edit_the_mountlist() --- starting");
    158158
    159159    assert(bkpinfo != NULL);
     
    162162    if (!bkpinfo->disaster_recovery) {
    163163        mr_allocstr(g_mountlist_fname, "/tmp/mountlist.txt");
    164         log_msg(2, "I guess you're testing edit_mountlist()");
     164        mr_msg(2, "I guess you're testing edit_mountlist()");
    165165    }
    166166    if (!does_file_exist(g_mountlist_fname)) {
     
    207207    for (i = 0; i < mountlist->entries; i++) {
    208208        if (strstr(mountlist->el[i].format, "ompaq")) {
    209             log_msg(2, "mountlist[%d] (%s) is %s (Compaq alert!)",
     209            mr_msg(2, "mountlist[%d] (%s) is %s (Compaq alert!)",
    210210                    i, mountlist->el[i].device, mountlist->el[i].format);
    211211
     
    286286    if (bkpinfo->backup_media_type == iso) {
    287287        if (iso_fiddly_bits(bkpinfo, (c == 'N') ? TRUE : FALSE)) {
    288             log_msg(2,
     288            mr_msg(2,
    289289                    "catchall_mode --- iso_fiddly_bits returned w/ error");
    290290            return (1);
    291291        } else {
    292             log_msg(2, "catchall_mode --- iso_fiddly_bits ok");
     292            mr_msg(2, "catchall_mode --- iso_fiddly_bits ok");
    293293        }
    294294    }
    295295
    296296    if (c == 'I') {
    297         log_msg(2, "IM selected");
     297        mr_msg(2, "IM selected");
    298298        retval += interactive_mode(bkpinfo, mountlist, raidlist);
    299299    } else if (c == 'N') {
    300         log_msg(2, "NM selected");
     300        mr_msg(2, "NM selected");
    301301        retval += nuke_mode(bkpinfo, mountlist, raidlist);
    302302    } else if (c == 'C') {
    303         log_msg(2, "CM selected");
     303        mr_msg(2, "CM selected");
    304304        retval += compare_mode(bkpinfo, mountlist, raidlist);
    305305    }
     
    351351    /* try to partition and format */
    352352
    353     log_msg(2, "interactive_mode --- starting (great, assertions OK)");
     353    mr_msg(2, "interactive_mode --- starting (great, assertions OK)");
    354354
    355355    assert(bkpinfo != NULL);
     
    357357    assert(raidlist != NULL);
    358358
    359     log_msg(2, "interactive_mode --- assertions OK");
     359    mr_msg(2, "interactive_mode --- assertions OK");
    360360
    361361    if (g_text_mode) {
     
    378378#endif
    379379    if (strstr(tmp,"noresize")) {
    380         log_msg(1, "Not resizing mountlist.");
     380        mr_msg(1, "Not resizing mountlist.");
    381381    } else {
    382382        resize_mountlist_proportionately_to_suit_new_drives(mountlist);
     
    400400            paranoid_MR_finish(1);
    401401        }
    402         log_msg(2, "Proceeding...");
     402        mr_msg(2, "Proceeding...");
    403403        save_mountlist_to_disk(mountlist, g_mountlist_fname);
    404404        save_raidlist_to_raidtab(raidlist, RAIDTAB_FNAME);
     
    496496                          ("Do you want me to restore all of your data?"))))
    497497    {
    498         log_msg(1, "Restoring all data");
     498        mr_msg(1, "Restoring all data");
    499499        retval += restore_everything(bkpinfo, NULL);
    500500    } else if ((restore_all =
     
    520520                        mr_allocstr(bkpinfo->restore_path, ""); // so we restore to [blank]/file/name :)
    521521                    }
    522                     log_msg(1, "Restoring subset");
     522                    mr_msg(1, "Restoring subset");
    523523                    retval += restore_everything(bkpinfo, filelist);
    524524                    free_filelist(filelist);
     
    626626    assert(raidlist != NULL);
    627627    if (iso_fiddly_bits(bkpinfo, nuke_me_please)) {
    628         log_msg(1, "iso_mode --- returning w/ error");
     628        mr_msg(1, "iso_mode --- returning w/ error");
    629629        return (1);
    630630    } else {
     
    726726    assert(raidlist != NULL);
    727727
    728     log_msg(2, "nuke_mode --- starting");
     728    mr_msg(2, "nuke_mode --- starting");
    729729
    730730    get_cfg_file_from_archive_or_bust(bkpinfo);
     
    736736#endif
    737737    if (strstr(tmp,"noresize")) {
    738         log_msg(2, "Not resizing mountlist.");
     738        mr_msg(2, "Not resizing mountlist.");
    739739    } else {
    740740        resize_mountlist_proportionately_to_suit_new_drives(mountlist);
     
    776776#endif
    777777            if (strstr(tmp,"nopart")) {
    778                 log_msg(2,
     778                mr_msg(2,
    779779                        "Not partitioning drives due to 'nopart' option.");
    780780                res = 0;
     
    829829    retval += restore_everything(bkpinfo, NULL);
    830830    if (!run_boot_loader(FALSE)) {
    831         log_msg(1,
     831        mr_msg(1,
    832832                "Great! Boot loader was installed. No need for msg at end.");
    833833        boot_loader_installed = TRUE;
     
    907907    struct s_node *filelist = NULL;
    908908
    909     log_msg(1, "restore_to_live_filesystem() - starting");
     909    mr_msg(1, "restore_to_live_filesystem() - starting");
    910910    assert(bkpinfo != NULL);
    911911
     
    922922    interactively_obtain_media_parameters_from_user(bkpinfo, FALSE);
    923923    if (bkpinfo->media_device == NULL) {
    924         log_msg(2, "Warning - failed to find media dev");
     924        mr_msg(2, "Warning - failed to find media dev");
    925925    } else {
    926         log_msg(2, "bkpinfo->media_device = %s", bkpinfo->media_device);
    927     }
    928 
    929 
    930     log_msg(2, "bkpinfo->isodir = %s", bkpinfo->isodir);
     926        mr_msg(2, "bkpinfo->media_device = %s", bkpinfo->media_device);
     927    }
     928
     929
     930    mr_msg(2, "bkpinfo->isodir = %s", bkpinfo->isodir);
    931931
    932932    open_evalcall_form(_("Thinking..."));
     
    953953    }
    954954    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    955         log_msg(2,
     955        mr_msg(2,
    956956                "I probably don't need to unmount or eject the CD-ROM but I'm doing it anyway.");
    957957    }
     
    10381038    if (fread((void *) &biggiestruct, 1, sizeof(biggiestruct), fin) <
    10391039        sizeof(biggiestruct)) {
    1040         log_msg(2, "Warning - unable to get biggiestruct of bigfile #%d",
     1040        mr_msg(2, "Warning - unable to get biggiestruct of bigfile #%d",
    10411041                bigfileno + 1);
    10421042    }
     
    10481048        mr_asprintf(&tmp, "Warning - bigfile %ld does not have a checksum",
    10491049                bigfileno + 1);
    1050         log_msg(3, tmp);
     1050        mr_msg(3, tmp);
    10511051        mr_free(tmp);
    10521052        /* BERLIOS : Useless ???
     
    10681068        node = find_string_at_node(filelist, biggiestruct.filename);
    10691069        if (!node) {
    1070             log_msg(0, "Skipping %s (name isn't in filelist)",
     1070            mr_msg(0, "Skipping %s (name isn't in filelist)",
    10711071                    biggiestruct.filename);
    10721072            return (pathname_of_last_file_restored);
    10731073        } else if (!(node->selected)) {
    1074             log_msg(1, "Skipping %s (name isn't in biggielist subset)",
     1074            mr_msg(1, "Skipping %s (name isn't in biggielist subset)",
    10751075                    biggiestruct.filename);
    10761076            return (pathname_of_last_file_restored);
     
    10791079    /* otherwise, continue */
    10801080
    1081     log_msg(1, "DEFINITELY restoring %s", biggiestruct.filename);
     1081    mr_msg(1, "DEFINITELY restoring %s", biggiestruct.filename);
    10821082    if (biggiestruct.use_ntfsprog) {
    10831083        if (strncmp(biggiestruct.filename, "/dev/", 5)) {
    1084             log_msg(1,
     1084            mr_msg(1,
    10851085                    "I was in error when I set biggiestruct.use_ntfsprog to TRUE.");
    1086             log_msg(1, "%s isn't even in /dev", biggiestruct.filename);
     1086            mr_msg(1, "%s isn't even in /dev", biggiestruct.filename);
    10871087            biggiestruct.use_ntfsprog = FALSE;
    10881088        }
     
    10941094        g_loglevel = 4;
    10951095        use_ntfsprog_hack = TRUE;
    1096         log_msg(2,
     1096        mr_msg(2,
    10971097                "Calling ntfsclone in background because %s is an NTFS /dev entry",
    10981098                outfile_fname);
     
    11061106            fatal_error("Fork failure");
    11071107        case 0:
    1108             log_msg(3,
     1108            mr_msg(3,
    11091109                    "CHILD - fip - calling feed_outfrom_ntfsprog(%s, %s)",
    11101110                    biggiestruct.filename, ntfsprog_fifo);
     
    11121112                feed_outfrom_ntfsprog(biggiestruct.filename,
    11131113                                      ntfsprog_fifo);
    1114 //          log_msg(3, "CHILD - fip - exiting");
     1114//          mr_msg(3, "CHILD - fip - exiting");
    11151115            exit(res);
    11161116            break;
    11171117        default:
    1118             log_msg(3,
     1118            mr_msg(3,
    11191119                    "feed_into_ntfsprog() called in background --- pid=%ld",
    11201120                    (long int) (pid));
     
    11331133    mr_asprintf(&tmp, "Reassembling big file %ld (%s)", bigfileno + 1,
    11341134            outfile_fname);
    1135     log_msg(2, tmp);
     1135    mr_msg(2, tmp);
    11361136    mr_free(tmp);
    11371137
     
    11441144    mr_asprintf(&pathname_of_last_file_restored, biggiestruct.filename);
    11451145
    1146     log_msg(3, "file_to_openout = %s", file_to_openout);
     1146    mr_msg(3, "file_to_openout = %s", file_to_openout);
    11471147    if (!(fout = fopen(file_to_openout, "w"))) {
    11481148        log_to_screen(_("Cannot openout outfile_fname - hard disk full?"));
    11491149        return (pathname_of_last_file_restored);
    11501150    }
    1151     log_msg(3, "Opened out to %s", outfile_fname);  // CD/DVD --> mondorestore --> ntfsclone --> hard disk itself
     1151    mr_msg(3, "Opened out to %s", outfile_fname);   // CD/DVD --> mondorestore --> ntfsclone --> hard disk itself
    11521152
    11531153    for (sliceno = 1, finished = FALSE; !finished;) {
     
    11601160            !does_file_exist(tmp1) &&
    11611161            !does_file_exist(tmp2)) {
    1162             log_msg(3,
     1162            mr_msg(3,
    11631163                    "Cannot find a data slice or terminator slice on CD %d",
    11641164                    g_current_media_number);
     
    11681168                    bkpinfo->backup_media_string,
    11691169                    g_current_media_number, sliceno);
    1170             log_msg(2, tmp3);
     1170            mr_msg(2, tmp3);
    11711171            mr_free(tmp3);
    11721172
     
    11811181        } else {
    11821182            if (does_file_exist(tmp) && length_of_file(tmp) == 0) {
    1183                 log_msg(2,
     1183                mr_msg(2,
    11841184                        "End of bigfile # %ld (slice %ld is the terminator)",
    11851185                        bigfileno + 1, sliceno);
     
    12071207                    bkpinfo->backup_media_string,
    12081208                    g_current_media_number, bigfileno + 1, sliceno);
    1209             log_msg(2, tmp3);
     1209            mr_msg(2, tmp3);
    12101210            if (!g_text_mode) {
    12111211                newtDrawRootText(0, g_noof_rows - 2, tmp3);
     
    12431243
    12441244    if (use_ntfsprog_hack) {
    1245         log_msg(3, "Waiting for ntfsclone to finish");
     1245        mr_msg(3, "Waiting for ntfsclone to finish");
    12461246        mr_asprintf(&tmp,
    12471247                " ps | grep \" ntfsclone \" | grep -v grep > /dev/null 2> /dev/null");
     
    13211321    if (use_ntfsprog == BLK_START_A_PIHBIGGIE) {
    13221322        use_ntfsprog = 1;
    1323         log_msg(1, "%s --- pih=YES", orig_bf_fname);
     1323        mr_msg(1, "%s --- pih=YES", orig_bf_fname);
    13241324    } else if (use_ntfsprog == BLK_START_A_NORMBIGGIE) {
    13251325        use_ntfsprog = 0;
    1326         log_msg(1, "%s --- pih=NO", orig_bf_fname);
     1326        mr_msg(1, "%s --- pih=NO", orig_bf_fname);
    13271327    } else {
    13281328        use_ntfsprog = 0;
    1329         log_msg(1, "%s --- pih=NO (weird marker though)", orig_bf_fname);
     1329        mr_msg(1, "%s --- pih=NO (weird marker though)", orig_bf_fname);
    13301330    }
    13311331
     
    13381338        if (!node) {
    13391339            dummy_restore = TRUE;
    1340             log_msg(1,
     1340            mr_msg(1,
    13411341                    "Skipping big file %ld (%s) - not in biggielist subset",
    13421342                    biggiefile_number + 1, orig_bf_fname);
     
    13441344        } else if (!(node->selected)) {
    13451345            dummy_restore = TRUE;
    1346             log_msg(1, "Skipping %s (name isn't in biggielist subset)",
     1346            mr_msg(1, "Skipping %s (name isn't in biggielist subset)",
    13471347                    orig_bf_fname);
    13481348            pathname_of_last_file_restored = NULL;
     
    13521352    if (use_ntfsprog) {
    13531353        if (strncmp(orig_bf_fname, "/dev/", 5)) {
    1354             log_msg(1, "I was in error when I set use_ntfsprog to TRUE.");
    1355             log_msg(1, "%s isn't even in /dev", orig_bf_fname);
     1354            mr_msg(1, "I was in error when I set use_ntfsprog to TRUE.");
     1355            mr_msg(1, "%s isn't even in /dev", orig_bf_fname);
    13561356            use_ntfsprog = FALSE;
    13571357        }
     
    13621362        mr_asprintf(&outfile_fname, orig_bf_fname);
    13631363        use_ntfsprog_hack = TRUE;
    1364         log_msg(2,
     1364        mr_msg(2,
    13651365                "Calling ntfsclone in background because %s is a /dev entry",
    13661366                outfile_fname);
     
    13761376            fatal_error("Fork failure");
    13771377        case 0:
    1378             log_msg(3,
     1378            mr_msg(3,
    13791379                    "CHILD - fip - calling feed_outfrom_ntfsprog(%s, %s)",
    13801380                    outfile_fname, ntfsprog_fifo);
    13811381            res = feed_outfrom_ntfsprog(outfile_fname, ntfsprog_fifo);
    1382 //          log_msg(3, "CHILD - fip - exiting");
     1382//          mr_msg(3, "CHILD - fip - exiting");
    13831383            exit(res);
    13841384            break;
    13851385        default:
    1386             log_msg(3,
     1386            mr_msg(3,
    13871387                    "feed_into_ntfsprog() called in background --- pid=%ld",
    13881388                    (long int) (pid));
     
    14061406        mr_asprintf(&tmp1, "Reassembling big file %ld (%s)",
    14071407                biggiefile_number + 1, orig_bf_fname);
    1408         log_msg(2, tmp1);
     1408        mr_msg(2, tmp1);
    14091409        mr_free(tmp1);
    14101410    }
     
    14221422    }
    14231423    mr_asprintf(&tmp1, "Pipe command = '%s'", command);
    1424     log_msg(3, tmp1);
     1424    mr_msg(3, tmp1);
    14251425    mr_free(tmp1);
    14261426
     
    14391439        mr_asprintf(&tmp1, "Working on file #%ld, slice #%ld    ",
    14401440                biggiefile_number + 1, current_slice_number);
    1441         log_msg(2, tmp1);
     1441        mr_msg(2, tmp1);
    14421442
    14431443        if (!g_text_mode) {
     
    14601460                    ((void *) &biggiestruct, 1, sizeof(biggiestruct),
    14611461                     fin) < sizeof(biggiestruct)) {
    1462                     log_msg(2,
     1462                    mr_msg(2,
    14631463                            "Warning - unable to get biggiestruct of bigfile #%d",
    14641464                            biggiefile_number + 1);
     
    14811481    paranoid_pclose(pout);
    14821482
    1483     log_msg(1, "pathname_of_last_file_restored is now %s",
     1483    mr_msg(1, "pathname_of_last_file_restored is now %s",
    14841484            pathname_of_last_file_restored);
    14851485
    14861486    if (use_ntfsprog_hack) {
    1487         log_msg(3, "Waiting for ntfsclone to finish");
     1487        mr_msg(3, "Waiting for ntfsclone to finish");
    14881488        mr_asprintf(&tmp,
    14891489                " ps | grep \" ntfsclone \" | grep -v grep > /dev/null 2> /dev/null");
     
    14921492        }   
    14931493        mr_free(tmp);
    1494         log_msg(3, "OK, ntfsclone has really finished");
    1495     }
    1496 
    1497     log_msg(3, "biggiestruct.filename = %s", biggiestruct.filename);
    1498     log_msg(3, "biggiestruct.checksum = %s", biggiestruct.checksum);
     1494        mr_msg(3, "OK, ntfsclone has really finished");
     1495    }
     1496
     1497    mr_msg(3, "biggiestruct.filename = %s", biggiestruct.filename);
     1498    mr_msg(3, "biggiestruct.checksum = %s", biggiestruct.checksum);
    14991499    if (strcmp(outfile_fname, "/dev/null")) {
    15001500        chmod(outfile_fname, biggiestruct.properties.st_mode);
     
    15501550    assert_string_is_neither_NULL_nor_zerolength(tarball_fname);
    15511551
    1552     log_msg(5, "Entering");
     1552    mr_msg(5, "Entering");
    15531553    use_star = (strstr(tarball_fname, ".star")) ? TRUE : FALSE;
    15541554    mr_asprintf(&command, "mkdir -p %s/tmp", MNT_RESTORING);
     
    15591559            current_tarball_number);
    15601560    if (length_of_file(filelist_name) <= 2) {
    1561         log_msg(2, "There are _zero_ files in filelist '%s'",
     1561        mr_msg(2, "There are _zero_ files in filelist '%s'",
    15621562                filelist_name);
    1563         log_msg(2,
     1563        mr_msg(2,
    15641564                "This is a bit silly (ask dev-team to fix mondo_makefilelist, please)");
    1565         log_msg(2,
     1565        mr_msg(2,
    15661566                "but it's non-critical. It's cosmetic. Don't worry about it.");
    15671567        retval = 0;
    1568         log_msg(5, "Leaving");
     1568        mr_msg(5, "Leaving");
    15691569        return (retval);
    15701570    }
    15711571    if (count_lines_in_file(filelist_name) <= 0
    15721572        || length_of_file(tarball_fname) <= 0) {
    1573         log_msg(3, "length_of_file(%s) = %llu", tarball_fname,
     1573        mr_msg(3, "length_of_file(%s) = %llu", tarball_fname,
    15741574                length_of_file(tarball_fname));
    15751575        mr_asprintf(&tmp, "Unable to restore fileset #%ld (CD I/O error)",
     
    15781578        mr_free(tmp);
    15791579        retval = 1;
    1580         log_msg(5, "Leaving");
     1580        mr_msg(5, "Leaving");
    15811581        return (retval);
    15821582    }
     
    15911591            <= 0) {
    15921592            mr_asprintf(&tmp, "Skipping fileset %ld", current_tarball_number);
    1593             log_msg(1, tmp);
     1593            mr_msg(1, tmp);
    15941594            mr_free(tmp);
    15951595        } else {
    1596             log_msg(3, "Saved fileset %ld's subset to %s",
     1596            mr_msg(3, "Saved fileset %ld's subset to %s",
    15971597                    current_tarball_number, filelist_subset_fname);
    15981598        }
     
    16781678
    16791679#undef BUFSIZE
    1680         log_msg(1, "command = '%s'", command);
     1680        mr_msg(1, "command = '%s'", command);
    16811681        unlink(temp_log);
    16821682        res = system(command);
     
    16851685            if (p) {
    16861686                p[0] = p[1] = p[2] = p[3] = ' ';
    1687                 log_msg(1, "new command = '%s'", command);
     1687                mr_msg(1, "new command = '%s'", command);
    16881688                res = system(command);
    16891689            }
     
    16961696
    16971697        if (g_getfattr) {
    1698             log_msg(1, "Setting fattr list %s", xattr_fname);
     1698            mr_msg(1, "Setting fattr list %s", xattr_fname);
    16991699            if (length_of_file(xattr_fname) > 0) {
    17001700                res = set_fattr_list(filelist_subset_fname, xattr_fname);
     
    17031703                        ("Errors occurred while setting extended attributes");
    17041704                } else {
    1705                     log_msg(1, "I set xattr OK");
     1705                    mr_msg(1, "I set xattr OK");
    17061706                }
    17071707                retval += res;
     
    17091709        }
    17101710        if (g_getfacl) {
    1711             log_msg(1, "Setting acl list %s", acl_fname);
     1711            mr_msg(1, "Setting acl list %s", acl_fname);
    17121712            if (length_of_file(acl_fname) > 0) {
    17131713                res = set_acl_list(filelist_subset_fname, acl_fname);
     
    17161716                        ("Errors occurred while setting access control lists");
    17171717                } else {
    1718                     log_msg(1, "I set ACL OK");
     1718                    mr_msg(1, "I set ACL OK");
    17191719                }
    17201720                retval += res;
     
    17251725            system(command);
    17261726            mr_free(command);
    1727             log_msg(2, "Errors occurred while processing fileset #%d",
     1727            mr_msg(2, "Errors occurred while processing fileset #%d",
    17281728                    current_tarball_number);
    17291729        } else {
    1730             log_msg(2, "Fileset #%d processed OK", current_tarball_number);
     1730            mr_msg(2, "Fileset #%d processed OK", current_tarball_number);
    17311731        }
    17321732        unlink(xattr_fname);
     
    17451745    mr_free(acl_fname);
    17461746    mr_free(temp_log);
    1747     log_msg(5, "Leaving");
     1747    mr_msg(5, "Leaving");
    17481748    return (retval);
    17491749}
     
    18001800            bkpinfo->backup_media_string,
    18011801            g_current_media_number);
    1802     log_msg(2, tmp);
     1802    mr_msg(2, tmp);
    18031803    mr_free(tmp);
    18041804    run_program_and_log_output("mkdir -p " MNT_RESTORING "/tmp", FALSE);
     
    18201820    }
    18211821    if (res) {
    1822         log_msg(1, "Warning - error reading afioball from tape");
     1822        mr_msg(1, "Warning - error reading afioball from tape");
    18231823    }
    18241824    if (bkpinfo->compression_level != 0) {
     
    18431843                    executable, afio_fname, filelist_fname, MONDO_LOGFILE);
    18441844        }
    1845         log_msg(1, "command = %s", command);
     1845        mr_msg(1, "command = %s", command);
    18461846        if (system(command)) {
    1847             log_msg(4, "Warning - error occurred while retrieving TOC");
     1847            mr_msg(4, "Warning - error occurred while retrieving TOC");
    18481848        }
    18491849        mr_free(command);
     
    18541854            <= 0 || length_of_file(filelist_subset_fname) < 2) {
    18551855            if (length_of_file(filelist_subset_fname) < 2) {
    1856                 log_msg(1, "No matches found in fileset %ld",
     1856                mr_msg(1, "No matches found in fileset %ld",
    18571857                        current_tarball_number);
    18581858            }
    18591859            mr_asprintf(&tmp, "Skipping fileset %ld", current_tarball_number);
    1860             log_msg(2, tmp);
     1860            mr_msg(2, tmp);
    18611861            mr_free(tmp);
    18621862            restore_this_fileset = FALSE;
    18631863        } else {
    1864             log_msg(5, "%ld matches. Saved fileset %ld's subset to %s",
     1864            mr_msg(5, "%ld matches. Saved fileset %ld's subset to %s",
    18651865                    matches, current_tarball_number,
    18661866                    filelist_subset_fname);
     
    18921892    // Call if IF there are files to restore (selectively/unconditionally)
    18931893    if (restore_this_fileset) {
    1894         log_msg(1, "Calling command='%s'", command);
     1894        mr_msg(1, "Calling command='%s'", command);
    18951895        paranoid_system(command);
    18961896
     
    18991899            res = set_fattr_list(filelist_subset_fname, xattr_fname);
    19001900            if (res) {
    1901                 log_msg(1, "Errors occurred while setting xattr");
     1901                mr_msg(1, "Errors occurred while setting xattr");
    19021902            } else {
    1903                 log_msg(1, "I set xattr OK");
     1903                mr_msg(1, "I set xattr OK");
    19041904            }
    19051905            retval += res;
     
    19101910            res = set_acl_list(filelist_subset_fname, acl_fname);
    19111911            if (res) {
    1912                 log_msg(1, "Errors occurred while setting ACL");
     1912                mr_msg(1, "Errors occurred while setting ACL");
    19131913            } else {
    1914                 log_msg(1, "I set ACL OK");
     1914                mr_msg(1, "I set ACL OK");
    19151915            }
    19161916            retval += res;
     
    19181918
    19191919    } else {
    1920         log_msg(1, "NOT CALLING '%s'", command);
     1920        mr_msg(1, "NOT CALLING '%s'", command);
    19211921    }
    19221922    mr_free(command);
     
    19701970            "%s/biggies-whose-EXATs-we-should-set", bkpinfo->tmpdir);
    19711971    if (!(fbw = fopen(biggies_whose_EXATs_we_should_set, "w"))) {
    1972         log_msg(1, "Warning - cannot openout %s",
     1972        mr_msg(1, "Warning - cannot openout %s",
    19731973                biggies_whose_EXATs_we_should_set);
    19741974    }
     
    19831983
    19841984    if (length_of_file(BIGGIELIST) < 6) {
    1985         log_msg(1, "OK, no biggielist; not restoring biggiefiles");
     1985        mr_msg(1, "OK, no biggielist; not restoring biggiefiles");
    19861986        return (0);
    19871987    }
    19881988    noof_biggiefiles = count_lines_in_file(BIGGIELIST);
    19891989    if (noof_biggiefiles <= 0) {
    1990         log_msg(2,
     1990        mr_msg(2,
    19911991                "OK, no biggiefiles in biggielist; not restoring biggiefiles");
    19921992        return (0);
     
    19941994    mr_asprintf(&tmp, "OK, there are %ld biggiefiles in the archives",
    19951995            noof_biggiefiles);
    1996     log_msg(2, tmp);
     1996    mr_msg(2, tmp);
    19971997    mr_free(tmp);
    19981998
     
    20022002                       "", total_slices);
    20032003    for (bigfileno = 0, finished = FALSE; !finished;) {
    2004         log_msg(2, "Thinking about restoring bigfile %ld", bigfileno + 1);
     2004        mr_msg(2, "Thinking about restoring bigfile %ld", bigfileno + 1);
    20052005        tmp = slice_fname(bigfileno, 0, ARCHIVES_PATH, "");
    20062006        if (!does_file_exist(tmp)) {
    2007             log_msg(3,
     2007            mr_msg(3,
    20082008                    "...but its first slice isn't on this CD. Perhaps this was a selective restore?");
    2009             log_msg(3, "Cannot find bigfile #%ld 's first slice on %s #%d",
     2009            mr_msg(3, "Cannot find bigfile #%ld 's first slice on %s #%d",
    20102010                    bigfileno + 1,
    20112011                    bkpinfo->backup_media_string,
    20122012                    g_current_media_number);
    20132013            tmp1 = slice_fname(bigfileno + 1, 0, ARCHIVES_PATH, "");
    2014             log_msg(3, "Slicename would have been %s", tmp1);
     2014            mr_msg(3, "Slicename would have been %s", tmp1);
    20152015            mr_free(tmp1);
    20162016
     
    20182018            if (just_changed_cds) {
    20192019                just_changed_cds = FALSE;
    2020                 log_msg(3,
     2020                mr_msg(3,
    20212021                        "I'll continue to scan this CD for bigfiles to be restored.");
    20222022            } else if (does_file_exist(MNT_CDROM "/archives/NOT-THE-LAST")) {
     
    20312031                just_changed_cds = TRUE;
    20322032            } else {
    2033                 log_msg(2, "There was no bigfile #%ld. That's OK.",
     2033                mr_msg(2, "There was no bigfile #%ld. That's OK.",
    20342034                        bigfileno + 1);
    2035                 log_msg(2, "I'm going to stop restoring bigfiles now.");
     2035                mr_msg(2, "I'm going to stop restoring bigfiles now.");
    20362036                finished = TRUE;
    20372037            }
     
    21222122
    21232123    mvaddstr_and_log_it(g_currentY, 0, _("Restoring from archives"));
    2124     log_msg(2,
     2124    mr_msg(2,
    21252125            "Insisting on 1st CD, so that I can have a look at LAST-FILELIST-NUMBER");
    21262126    if (g_current_media_number != 1) {
    2127         log_msg(3, "OK, that's jacked up.");
     2127        mr_msg(3, "OK, that's jacked up.");
    21282128        g_current_media_number = 1;
    21292129    }
     
    21992199                    bkpinfo->backup_media_string,
    22002200                    g_current_media_number);
    2201 //    log_msg(3, "progress_str = %s", progress_str);
     2201//    mr_msg(3, "progress_str = %s", progress_str);
    22022202            for (res = 999, attempts = 0; attempts < 3 && res != 0;
    22032203                 attempts++) {
     
    22992299            "%s/biggies-whose-EXATs-we-should-set", bkpinfo->tmpdir);
    23002300    if (!(fbw = fopen(biggies_whose_EXATs_we_should_set, "w"))) {
    2301         log_msg(1, "Warning - cannot openout %s",
     2301        mr_msg(1, "Warning - cannot openout %s",
    23022302                biggies_whose_EXATs_we_should_set);
    23032303    }
     
    23152315    mr_asprintf(&tmp, "OK, there are %ld biggiefiles in the archives",
    23162316            noof_biggiefiles);
    2317     log_msg(2, tmp);
     2317    mr_msg(2, tmp);
    23182318    mr_free(tmp);
    23192319
     
    23502350                                               current_bigfile_number,
    23512351                                               filelist, ctrl_chr);
    2352         log_msg(1, "I believe I have restored %s",
     2352        mr_msg(1, "I believe I have restored %s",
    23532353                pathname_of_last_biggie_restored);
    23542354        if (fbw && pathname_of_last_biggie_restored[0]) {
     
    23702370                noof_biggiefiles, current_bigfile_number);
    23712371    }
    2372     log_msg(1, tmp);
     2372    mr_msg(1, tmp);
    23732373    mr_free(tmp);
    23742374
     
    23792379            if (g_getfattr) {
    23802380                if (length_of_file(xattr_fname) > 0) {
    2381                     log_msg(1, "set_fattr_List(%s,%s)",
     2381                    mr_msg(1, "set_fattr_List(%s,%s)",
    23822382                        biggies_whose_EXATs_we_should_set, xattr_fname);
    23832383                    set_fattr_list(biggies_whose_EXATs_we_should_set,
     
    23872387            if (g_getfacl) {
    23882388                if (length_of_file(acl_fname) > 0) {
    2389                     log_msg(1, "set_acl_list(%s,%s)",
     2389                    mr_msg(1, "set_acl_list(%s,%s)",
    23902390                            biggies_whose_EXATs_we_should_set, acl_fname);
    23912391                    set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname);
     
    24692469                       progress_str, max_val);
    24702470
    2471     log_msg(3, "hey");
     2471    mr_msg(3, "hey");
    24722472
    24732473    res = read_header_block_from_stream(&tmp_size, tmp_fname, &ctrl_chr);
    24742474    if (res) {
    2475         log_msg(2, "Warning - error reading afioball from tape");
     2475        mr_msg(2, "Warning - error reading afioball from tape");
    24762476    }
    24772477    retval += res;
     
    24792479        wrong_marker(BLK_START_AFIOBALLS, ctrl_chr);
    24802480    }
    2481     log_msg(2, "ho");
     2481    mr_msg(2, "ho");
    24822482    res = read_header_block_from_stream(&tmp_size, tmp_fname, &ctrl_chr);
    24832483    while (ctrl_chr != BLK_STOP_AFIOBALLS) {
     
    25482548    mr_free(tmp_fname);
    25492549
    2550     log_msg(1, "All done with afioballs");
     2550    mr_msg(1, "All done with afioballs");
    25512551    close_progress_form();
    25522552    if (retval) {
     
    25862586    malloc_string(cwd);
    25872587    malloc_string(newpath);
    2588     log_msg(2, "restore_everything() --- starting");
     2588    mr_msg(2, "restore_everything() --- starting");
    25892589    g_current_media_number = 1;
    25902590    /* BERLIOS: should test return value, or better change the function */
     
    25942594    mr_free(tmp);
    25952595
    2596     log_msg(1, "Changing dir to %s", bkpinfo->restore_path);
     2596    mr_msg(1, "Changing dir to %s", bkpinfo->restore_path);
    25972597    chdir(bkpinfo->restore_path);
    25982598    /* BERLIOS: should test return value, or better change the function */
    25992599    getcwd(newpath, MAX_STR_LEN - 1);
    2600     log_msg(1, "path is now %s", newpath);
    2601     log_msg(1, "restoring everything");
     2600    mr_msg(1, "path is now %s", newpath);
     2601    mr_msg(1, "restoring everything");
    26022602    tmp = find_home_of_exe("petris");
    26032603    if (!tmp && !g_text_mode) {
     
    26422642    }
    26432643    if (length_of_file("/etc/raidtab") > 0) {
    2644         log_msg(2, "Copying local raidtab to restored filesystem");
     2644        mr_msg(2, "Copying local raidtab to restored filesystem");
    26452645        run_program_and_log_output("cp -f /etc/raidtab " MNT_RESTORING
    26462646                                   "/etc/raidtab", FALSE);
    26472647    }
    26482648    kill_petris();
    2649     log_msg(2, "restore_everything() --- leaving");
     2649    mr_msg(2, "restore_everything() --- leaving");
    26502650    mr_free(cwd);
    26512651    mr_free(newpath);
     
    26902690    sprintf(tmp, "restore_here = '%s'", restore_here);
    26912691
    2692     log_msg(2, tmp);
    2693 
    2694     log_msg(2, "restore_live_from_monitas_server() - starting");
     2692    mr_msg(2, tmp);
     2693
     2694    mr_msg(2, "restore_live_from_monitas_server() - starting");
    26952695    unlink("/tmp/mountlist.txt");
    26962696    unlink("/tmp/filelist.full");
     
    27012701        strcpy(bkpinfo->restore_path, restore_here);
    27022702    }
    2703     log_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");
     2703    mr_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");
    27042704    sprintf(tmp, "FYI - data will be restored to %s",
    27052705            bkpinfo->restore_path);
    2706     log_msg(3, tmp);
    2707     log_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");
     2706    mr_msg(3, tmp);
     2707    mr_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");
    27082708    sprintf(datadisks_fname, "/tmp/mondorestore.datadisks.%d",
    27092709            (int) (random() % 32768));
     
    27562756            restore_this_directory, g_biggielist_txt, g_biggielist_txt);
    27572757    if (system(command)) {
    2758         log_msg(1,
     2758        mr_msg(1,
    27592759                "Error(s) occurred while processing biggielist and wildcard");
    27602760    }
     
    27642764    retval += restore_everything(bkpinfo, filelist);
    27652765    free_filelist(filelist);
    2766     log_msg(2, "--------End of restore_live_from_monitas_server--------");
     2766    mr_msg(2, "--------End of restore_live_from_monitas_server--------");
    27672767    return (retval);
    27682768}
     
    27852785void welcome_to_mondorestore()
    27862786{
    2787     log_msg(0, "-------------- Mondo Restore v%s -------------",
     2787    mr_msg(0, "-------------- Mondo Restore v%s -------------",
    27882788            PACKAGE_VERSION);
    2789     log_msg(0,
     2789    mr_msg(0,
    27902790            "DON'T PANIC! Mondorestore logs almost everything, so please ");
    2791     log_msg(0,
     2791    mr_msg(0,
    27922792            "don't break out in a cold sweat just because you see a few  ");
    2793     log_msg(0,
     2793    mr_msg(0,
    27942794            "error messages in the log. Read them; analyze them; see if  ");
    2795     log_msg(0,
     2795    mr_msg(0,
    27962796            "they are significant; above all, verify your backups! Please");
    2797     log_msg(0,
     2797    mr_msg(0,
    27982798            "attach a compressed copy of this log to any e-mail you send ");
    2799     log_msg(0,
     2799    mr_msg(0,
    28002800            "to the Mondo mailing list when you are seeking technical    ");
    2801     log_msg(0,
     2801    mr_msg(0,
    28022802            "support. Without it, we can't help you.            - DevTeam");
    2803     log_msg(0,
     2803    mr_msg(0,
    28042804            "------------------------------------------------------------");
    2805     log_msg(0,
     2805    mr_msg(0,
    28062806            "BTW, despite (or perhaps because of) the wealth of messages,");
    2807     log_msg(0,
     2807    mr_msg(0,
    28082808            "some users are inclined to stop reading this log.  If Mondo ");
    2809     log_msg(0,
     2809    mr_msg(0,
    28102810            "stopped for some reason, chances are it's detailed here.    ");
    2811     log_msg(0,
     2811    mr_msg(0,
    28122812            "More than likely there's a message near the end of this     ");
    2813     log_msg(0,
     2813    mr_msg(0,
    28142814            "log that will tell you what is wrong.  Please read it!      ");
    2815     log_msg(0,
     2815    mr_msg(0,
    28162816            "------------------------------------------------------------");
    28172817}
     
    28632863    if (strstr(tmp,"textonly")) {
    28642864        g_text_mode = TRUE;
    2865         log_msg(1, "TEXTONLY MODE");
     2865        mr_msg(1, "TEXTONLY MODE");
    28662866    } else {
    28672867        g_text_mode = FALSE;
     
    28962896    g_kernel_version = get_kernel_version();
    28972897
    2898     log_msg(1, "FYI - g_mountlist_fname = %s", g_mountlist_fname);
     2898    mr_msg(1, "FYI - g_mountlist_fname = %s", g_mountlist_fname);
    28992899    mkdir(MNT_CDROM, 0x770);
    29002900
     
    29022902    mr_asprintf(&tmp, "%s.orig", g_mountlist_fname);
    29032903    if (!does_file_exist(g_mountlist_fname)) {
    2904         log_msg(2,
     2904        mr_msg(2,
    29052905                "%ld: Warning - g_mountlist_fname (%s) does not exist yet",
    29062906                __LINE__, g_mountlist_fname);
     
    29322932    welcome_to_mondorestore();
    29332933    if (bkpinfo->disaster_recovery) {
    2934         log_msg(1, "I am in disaster recovery mode");
     2934        mr_msg(1, "I am in disaster recovery mode");
    29352935    } else {
    2936         log_msg(1, "I am in normal, live mode");
     2936        mr_msg(1, "I am in normal, live mode");
    29372937    }
    29382938
     
    30193019
    30203020    if (argc == 5 && strcmp(argv[1], "--copy") == 0) {
    3021         log_msg(1, "SCORE");
     3021        mr_msg(1, "SCORE");
    30223022        g_loglevel = 10;
    30233023        if (strstr(argv[2], "save")) {
    3024             log_msg(1, "Saving from %s to %s", argv[3], argv[4]);
     3024            mr_msg(1, "Saving from %s to %s", argv[3], argv[4]);
    30253025            fin = fopen(argv[3], "r");
    30263026            fout = fopen(argv[4], "w");
     
    30753075//    return(1);
    30763076        }
    3077         log_msg(1, "I am in normal, live mode.");
    3078         log_msg(2, "FYI, MOUNTLIST_FNAME = %s", g_mountlist_fname);
     3077        mr_msg(1, "I am in normal, live mode.");
     3078        mr_msg(2, "FYI, MOUNTLIST_FNAME = %s", g_mountlist_fname);
    30793079        mount_boot_if_necessary();  /* for Gentoo users */
    3080         log_msg(2, "Still here.");
     3080        mr_msg(2, "Still here.");
    30813081        if (argc > 1 && strcmp(argv[argc - 1], "--live-from-cd") == 0) {
    30823082            g_restoring_live_from_cd = TRUE;
    30833083        } else {
    3084             log_msg(2, "Calling restore_to_live_filesystem()");
     3084            mr_msg(2, "Calling restore_to_live_filesystem()");
    30853085            retval = restore_to_live_filesystem(bkpinfo);
    30863086        }
    3087         log_msg(2, "Still here. Yay.");
     3087        mr_msg(2, "Still here. Yay.");
    30883088        if (strlen(bkpinfo->tmpdir) > 0) {
    30893089            mr_asprintf(&tmp, "rm -Rf %s/*", bkpinfo->tmpdir);
     
    30953095    } else {
    30963096        /* Disaster recovery mode (must be) */
    3097         log_msg(1, "I must be in disaster recovery mode.");
    3098         log_msg(2, "FYI, MOUNTLIST_FNAME = %s ", g_mountlist_fname);
     3097        mr_msg(1, "I must be in disaster recovery mode.");
     3098        mr_msg(2, "FYI, MOUNTLIST_FNAME = %s ", g_mountlist_fname);
    30993099        if (argc == 3 && strcmp(argv[1], "--monitas-memorex") == 0) {
    31003100            log_to_screen(_("Uh, that hasn't been implemented yet."));
     
    31153115            if (bkpinfo->backup_media_type == nfs
    31163116                && !is_this_device_mounted(bkpinfo->nfs_mount)) {
    3117                 log_msg(1, "Mounting nfs dir");
     3117                mr_msg(1, "Mounting nfs dir");
    31183118                mr_allocstr(bkpinfo->isodir, "/tmp/isodir");
    31193119                run_program_and_log_output("mkdir -p /tmp/isodir", 5);
     
    31333133
    31343134
    3135         log_msg(1, "Send in the clowns.");
     3135        mr_msg(1, "Send in the clowns.");
    31363136
    31373137        if (argc == 2 && strcmp(argv[1], "--partition-only") == 0) {
    3138             log_msg(0, "Partitioning only.");
     3138            mr_msg(0, "Partitioning only.");
    31393139            load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
    31403140            mr_allocstr(g_mountlist_fname, "/tmp/mountlist.txt");
     
    31453145
    31463146        if (argc == 2 && strcmp(argv[1], "--format-only") == 0) {
    3147             log_msg(0, "Formatting only.");
     3147            mr_msg(0, "Formatting only.");
    31483148            load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
    31493149            mr_allocstr(g_mountlist_fname, "/tmp/mountlist.txt");
     
    31543154
    31553155        if (argc == 2 && strcmp(argv[1], "--stop-lvm-and-raid") == 0) {
    3156             log_msg(0, "Stopping LVM and RAID");
     3156            mr_msg(0, "Stopping LVM and RAID");
    31573157            load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);
    31583158            mr_allocstr(g_mountlist_fname, "/tmp/mountlist.txt");
     
    32413241// g_I_have_just_nuked is set true by nuke_mode() just before it returns
    32423242    if (!system("which post-nuke > /dev/null 2> /dev/null")) {
    3243       log_msg(1, "post-nuke found; find out whether we should run it...");
     3243      mr_msg(1, "post-nuke found; find out whether we should run it...");
    32443244      if (g_I_have_just_nuked || does_file_exist("/POST-NUKE-ANYWAY")) {
    32453245        run_postnuke = TRUE;
    3246         log_msg(1, "Yes, will run post-nuke because in nuke mode or file /POST-NUKE-ANYWAY exists.");
     3246        mr_msg(1, "Yes, will run post-nuke because in nuke mode or file /POST-NUKE-ANYWAY exists.");
    32473247      } else if (ask_me_yes_or_no("post-nuke script found. Do you want to run it?")) {
    32483248        run_postnuke = TRUE;
    3249         log_msg(1, "Yes, will run post-nuke because user interactively asked for it.");
     3249        mr_msg(1, "Yes, will run post-nuke because user interactively asked for it.");
    32503250      } else {
    32513251        run_postnuke = FALSE;
    3252         log_msg(1, "No, will not run post-nuke.");
     3252        mr_msg(1, "No, will not run post-nuke.");
    32533253      }
    32543254    } else {
    3255       log_msg(1, "No post-nuke found.");
     3255      mr_msg(1, "No post-nuke found.");
    32563256    }
    32573257    if (run_postnuke) {
     
    32613261          ("Unable to re-mount partitions for post-nuke stuff");
    32623262      } else {
    3263         log_msg(1, "Re-mounted partitions for post-nuke stuff");
     3263        mr_msg(1, "Re-mounted partitions for post-nuke stuff");
    32643264        sprintf(tmp, "post-nuke %s %d", bkpinfo->restore_path,
    32653265            retval);
    3266         log_msg(2, "Calling '%s'", tmp);
     3266        mr_msg(2, "Calling '%s'", tmp);
    32673267        if ((res = run_program_and_log_output(tmp, 0))) {
    32683268          log_OS_error(tmp);
    32693269        }
    3270         log_msg(1, "post-nuke returned w/ res=%d", res);
     3270        mr_msg(1, "post-nuke returned w/ res=%d", res);
    32713271      }
    32723272      unmount_all_devices(mountlist);
Note: See TracChangeset for help on using the changeset viewer.