Changeset 1747 in MondoRescue for branches/2.2.5/mondo


Ignore:
Timestamp:
Oct 30, 2007, 1:18:55 PM (16 years ago)
Author:
Bruno Cornec
Message:
  • Solve problem on tmpfs in restore init (Problem of inexistant symlink and busybox)
  • Create MONDO_CACHE and use it everywhere + creation at start
Location:
branches/2.2.5/mondo/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mondo/src/common/libmondo-archive.c

    r1713 r1747  
    40684068        log_msg(2,
    40694069                "Not verifying again. Per-CD/ISO verification already carried out.");
    4070         sprintf(tmp, "cat %s/changed.files > %s/changed.files 2> /dev/null",bkpinfo->tmpdir, MINDI_CACHE);
     4070        sprintf(tmp, "cat %s/changed.files > %s/changed.files 2> /dev/null",bkpinfo->tmpdir, MONDO_CACHE);
    40714071        paranoid_system(tmp);
    40724072    } else {
     
    41054105        sprintf(tmp,
    41064106                "grep 'afio: ' %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s/changed.files",
    4107                 MONDO_LOGFILE, MINDI_CACHE);
     4107                MONDO_LOGFILE, MONDO_CACHE);
    41084108        system(tmp);
    41094109
    41104110        sprintf(tmp,
    41114111                "grep 'star: ' %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s/changed.files",
    4112                 MONDO_LOGFILE, MINDI_CACHE);
     4112                MONDO_LOGFILE, MONDO_CACHE);
    41134113        system(tmp);
    41144114        run_program_and_log_output("umount " MNT_CDROM, FALSE);
     
    41184118//}
    41194119    }
    4120     sprintf(tmp, "%s/changed.files", MINDI_CACHE);
     4120    sprintf(tmp, "%s/changed.files", MONDO_CACHE);
    41214121    diffs = count_lines_in_file(tmp);
    41224122
  • branches/2.2.5/mondo/src/common/libmondo-filelist.c

    r1668 r1747  
    16871687                       char *userdef_filelist)
    16881688{
    1689     char sz_datefile_wildcard[] = "/var/cache/mondo-archive/difflevel.%d";
     1689    char sz_datefile_wildcard[] = MONDO_CACHE"/difflevel.%d";
    16901690    char *p, *q;
    16911691    char sz_datefile[80];
     
    17531753        snprintf(exclude_paths, (size_t)8*MAX_STR_LEN," %s %s %s %s %s %s . .. \
    17541754" MNT_CDROM " " MNT_FLOPPY " /media \
    1755 /proc /sys /root/images/mondo " MINDI_CACHE, excp, call_program_and_get_last_line_of_output("locate /win386.swp 2> /dev/null"), call_program_and_get_last_line_of_output("locate /hiberfil.sys 2> /dev/null"), call_program_and_get_last_line_of_output("locate /pagefile.sys 2> /dev/null"), (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir);
     1755/proc /sys /root/images/mondo " MINDI_CACHE, MONDO_CACHE, excp, call_program_and_get_last_line_of_output("locate /win386.swp 2> /dev/null"), call_program_and_get_last_line_of_output("locate /hiberfil.sys 2> /dev/null"), call_program_and_get_last_line_of_output("locate /pagefile.sys 2> /dev/null"), (tmpdir[0] == '/' && tmpdir[1] == '/') ? (tmpdir + 1) : tmpdir, (scratchdir[0] == '/' && scratchdir[1] == '/') ? (scratchdir + 1) : scratchdir);
    17561756
    17571757        log_msg(2, "Excluding paths = '%s'", exclude_paths);
  • branches/2.2.5/mondo/src/common/libmondo-files.c

    r1645 r1747  
    12761276            ("Unable to find ethN (eth0, eth1, ...) adapter via NFS mount you specified.");
    12771277    }
    1278     make_hole_for_dir("/var/cache/mondo-archive");
    12791278    /********
    12801279    * If the NFS device that found above is a bonded device,
  • branches/2.2.5/mondo/src/common/libmondo-tools.c

    r1744 r1747  
    938938
    939939    unlink(MONDO_TRACEFILE);
    940     asprintf(&tmp,"rm -Rf %s/changed.files*",MINDI_CACHE);
     940    asprintf(&tmp,"rm -Rf %s/changed.files*",MONDO_CACHE);
    941941    run_program_and_log_output(tmp, FALSE);
    942942    paranoid_free(tmp);
     
    11311131    }
    11321132#endif
    1133 
    1134     Lres = free_space_on_given_partition(MINDI_CACHE);
    1135     log_it("Free space on partition of %s = %ld MB", MINDI_CACHE, Lres);
    1136 
    1137     if (Lres < 50) {
    1138         sprintf(tmp, "The partition of %s has <50MB free. Please free up space or enlarge the partition or make %s a symbolic link.", MINDI_CACHE, MINDI_CACHE);
    1139         fatal_error(tmp);
    1140     }
    11411133
    11421134    if (system("which " MKE2FS_OR_NEWFS " > /dev/null 2> /dev/null")) {
  • branches/2.2.5/mondo/src/common/libmondo-verify.c

    r1711 r1747  
    13251325    if (diffs > 0) {
    13261326        sprintf(tmp, "cp -f %s %s/changed.files", changed_files_fname,
    1327                 MINDI_CACHE);
     1327                MONDO_CACHE);
    13281328        run_program_and_log_output(tmp, FALSE);
    13291329        sprintf(tmp,
    13301330                "%ld files differed from live filesystem; type less %s or less %s/changed.files to see",
    1331                 diffs, changed_files_fname, MINDI_CACHE);
     1331                diffs, changed_files_fname, MONDO_CACHE);
    13321332        log_msg(0, tmp);
    1333         log_to_screen("See "MINDI_CACHE"/changed.files for a list of nonmatching files.");
     1333        log_to_screen("See "MONDO_CACHE"/changed.files for a list of nonmatching files.");
    13341334        log_to_screen("The files probably changed on filesystem, not on backup media.");
    13351335        //      retval++;
  • branches/2.2.5/mondo/src/common/my-stuff.h

    r1688 r1747  
    235235 */
    236236#define MINDI_CACHE "/var/cache/mindi"
     237
     238/**
     239 * The location where mondo changed info are stored.
     240 */
     241#define MONDO_CACHE "/var/cache/mondo"
    237242
    238243/**
  • branches/2.2.5/mondo/src/common/newt-specific.c

    r1713 r1747  
    433433
    434434        printf("---FATALERROR--- %s\n", error_string);
    435         sprintf(command, "gzip -9c %s > %s/MA.log.gz 2> /dev/null", MONDO_LOGFILE, MINDI_CACHE);
     435        sprintf(command, "gzip -9c %s > %s/MA.log.gz 2> /dev/null", MONDO_LOGFILE, MONDO_CACHE);
    436436        system(command);
    437437        printf
     
    441441                ("The list's members can help you, if you attach that file to your e-mail.\n");
    442442        printf("Log file: %s\n", MONDO_LOGFILE);
    443         if (does_file_exist(MINDI_CACHE"/MA.log.gz")) {
    444             printf("FYI, I have gzipped the log and saved it to "MINDI_CACHE"/MA.log.gz.\n");
     443        if (does_file_exist(MONDO_CACHE"/MA.log.gz")) {
     444            printf("FYI, I have gzipped the log and saved it to "MONDO_CACHE"/MA.log.gz.\n");
    445445        }
    446446        printf("Mondo has aborted.\n");
  • branches/2.2.5/mondo/src/mondoarchive/main.c

    r1736 r1747  
    327327
    328328    log_msg(9, "Next");
     329    make_hole_for_dir(MONDO_CACHE);
     330
    329331    welcome_to_mondoarchive();
    330332    distro_specific_kludges_at_start_of_mondoarchive();
     
    505507    }
    506508
    507     if (length_of_file(MINDI_CACHE"/changed.files") > 2) {
     509    if (length_of_file(MONDO_CACHE"/changed.files") > 2) {
    508510        if (g_text_mode) {
    509             log_to_screen("Type 'less "MINDI_CACHE"/changed.files' to see which files don't match the archives");
    510         } else {
    511             log_msg(1, "Type 'less "MINDI_CACHE"/changed.files' to see which files don't match the archives");
     511            log_to_screen("Type 'less "MONDO_CACHE"/changed.files' to see which files don't match the archives");
     512        } else {
     513            log_msg(1, "Type 'less "MONDO_CACHE"/changed.files' to see which files don't match the archives");
    512514            log_msg(2, "Calling popup_changelist_from_file()");
    513             popup_changelist_from_file(MINDI_CACHE"/changed.files");
     515            popup_changelist_from_file(MONDO_CACHE"/changed.files");
    514516            log_msg(2, "Returned from popup_changelist_from_file()");
    515517        }
    516518    } else {
    517         unlink(MINDI_CACHE"/changed.files");
     519        unlink(MONDO_CACHE"/changed.files");
    518520    }
    519521    log_to_screen(say_at_end);
     
    528530    run_program_and_log_output("mount", 2);
    529531
    530     system("rm -f /var/cache/mondo-archive/last-backup.aborted");
     532    system("rm -f "MONDO_CACHE"/last-backup.aborted");
    531533    if (!retval) {
    532534        printf("Mondoarchive ran OK.\n");
  • branches/2.2.5/mondo/src/mondorestore/mondo-restore.c

    r1736 r1747  
    29572957    }
    29582958    mkdir(MNT_CDROM, 0x770);
     2959    make_hole_for_dir(MONDO_CACHE);
    29592960
    29602961/* Backup original mountlist.txt */
     
    32553256    /* clean up at the end */
    32563257    if (retval) {
    3257         if (does_file_exist(MINDI_CACHE"/changed.files")) {
     3258        if (does_file_exist(MONDO_CACHE"/changed.files")) {
    32583259            log_to_screen
    3259                 ("See "MINDI_CACHE"/changed.files for list of files that have changed.");
     3260                ("See "MONDO_CACHE"/changed.files for list of files that have changed.");
    32603261        }
    32613262        mvaddstr_and_log_it(g_currentY++,
  • branches/2.2.5/mondo/src/mondorestore/mondo-rstr-compare.c

    r1664 r1747  
    207207    log_msg(1, tmp_ptr);
    208208    if (retval) {
    209         if (!(fout = fopen(MINDI_CACHE"/changed.txt", "a"))) {
     209        if (!(fout = fopen(MONDO_CACHE"/changed.txt", "a"))) {
    210210            fatal_error("Cannot openout changed.txt");
    211211        }
     
    384384    if (length_of_file(logfile) > 5) {
    385385        sprintf(command,
    386                 "sed s/': \\\"'/\\|/ %s | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort -u | grep -vE \"^dev/.*\" >> "MINDI_CACHE"/changed.txt",
     386                "sed s/': \\\"'/\\|/ %s | sed s/'\\\": '/\\|/ | cut -d'|' -f2 | sort -u | grep -vE \"^dev/.*\" >> "MONDO_CACHE"/changed.txt",
    387387                logfile);
    388388        system(command);
     
    545545    getcwd(new, MAX_STR_LEN - 1);
    546546    insist_on_this_cd_number(g_current_media_number);
    547     unlink(MINDI_CACHE"/changed.txt");
     547    unlink(MONDO_CACHE"/changed.txt");
    548548
    549549    resA = compare_all_tarballs();
    550550    resB = compare_all_biggiefiles();
    551551    chdir(cwd);
    552     noof_changed_files = count_lines_in_file(MINDI_CACHE"/changed.txt");
     552    noof_changed_files = count_lines_in_file(MONDO_CACHE"/changed.txt");
    553553    if (noof_changed_files) {
    554554        sprintf(tmp, "%ld files do not match the backup            ",
     
    556556        //      mvaddstr_and_log_it( g_currentY++, 0, tmp );
    557557        log_to_screen(tmp);
    558         sprintf(command, "cat "MINDI_CACHE"/changed.txt >> %s", MONDO_LOGFILE);
     558        sprintf(command, "cat "MONDO_CACHE"/changed.txt >> %s", MONDO_LOGFILE);
    559559        paranoid_system(command);
    560560    } else {
     
    662662    }
    663663
    664     if (count_lines_in_file(MINDI_CACHE"/changed.txt") > 0) {
     664    if (count_lines_in_file(MONDO_CACHE"/changed.txt") > 0) {
    665665        mvaddstr_and_log_it(g_currentY++, 0,
    666666                            "Differences found while files were being compared.");
    667         streamline_changes_file(MINDI_CACHE"/changed.files", MINDI_CACHE"/changed.txt");
    668         if (count_lines_in_file(MINDI_CACHE"/changed.files") <= 0) {
     667        streamline_changes_file(MONDO_CACHE"/changed.files", MONDO_CACHE"/changed.txt");
     668        if (count_lines_in_file(MONDO_CACHE"/changed.files") <= 0) {
    669669            mvaddstr_and_log_it(g_currentY++, 0,
    670670                                "...but they were logfiles and temporary files. Your archives are fine.");
     
    672672                ("The differences were logfiles and temporary files. Your archives are fine.");
    673673        } else {
    674             q = count_lines_in_file(MINDI_CACHE"/changed.files");
     674            q = count_lines_in_file(MONDO_CACHE"/changed.files");
    675675            sprintf(tmp, "%ld significant difference%s found.", q,
    676676                    (q != 1) ? "s" : "");
     
    687687            chdir(bkpinfo->restore_path);
    688688            getcwd(new, MAX_STR_LEN - 1);
    689             popup_changelist_from_file(MINDI_CACHE"/changed.files");
     689            popup_changelist_from_file(MONDO_CACHE"/changed.files");
    690690            chdir(cwd);
    691691            log_msg(2, "Returning from popup_changelist_from_file()");
     
    744744    res = verify_tape_backups();
    745745    chdir(dir);
    746     if (length_of_file(MINDI_CACHE"/changed.txt") > 2
    747         && length_of_file(MINDI_CACHE"/changed.files") > 2) {
     746    if (length_of_file(MONDO_CACHE"/changed.txt") > 2
     747        && length_of_file(MONDO_CACHE"/changed.files") > 2) {
    748748        log_msg(0,
    749                 "Type 'less "MINDI_CACHE"/changed.files' to see which files don't match the archives");
     749                "Type 'less "MONDO_CACHE"/changed.files' to see which files don't match the archives");
    750750        log_msg(2, "Calling popup_changelist_from_file()");
    751         popup_changelist_from_file(MINDI_CACHE"/changed.files");
     751        popup_changelist_from_file(MONDO_CACHE"/changed.files");
    752752        log_msg(2, "Returned from popup_changelist_from_file()");
    753753    }
Note: See TracChangeset for help on using the changeset viewer.