Changeset 1987


Ignore:
Timestamp:
Jun 20, 2008, 4:08:40 AM (11 years ago)
Author:
bruno
Message:

Fix #260 restoring when cancel in non disaster mode was a regression on 2.2.5

Location:
branches/2.2.7/mondo/src/mondorestore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.7/mondo/src/mondorestore/mondo-rstr-tools.c

    r1971 r1987  
    12791279if (does_file_exist(g_filelist_full)
    12801280&& does_file_exist(g_biggielist_txt)) {
    1281 log_msg(1, "%s exists", g_filelist_full);
    1282 log_msg(1, "%s exists", g_biggielist_txt);
    1283 log_msg(2,
     1281    log_msg(1, "%s exists", g_filelist_full);
     1282    log_msg(1, "%s exists", g_biggielist_txt);
     1283    log_msg(2,
    12841284        "Filelist and biggielist already recovered from media. Yay!");
    12851285} else {
    1286 getcwd(tmp, MAX_STR_LEN);
    1287 chdir(bkpinfo->tmpdir);
    1288 log_msg(1, "chdir(%s)", bkpinfo->tmpdir);
    1289 log_to_screen("Extracting filelist and biggielist from media...");
    1290 unlink("/tmp/filelist.full");
    1291 unlink("/" FILELIST_FULL_STUB);
    1292 unlink("/tmp/i-want-my-lvm");
    1293 if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
    1294     sprintf(command,
     1286    getcwd(tmp, MAX_STR_LEN);
     1287    chdir(bkpinfo->tmpdir);
     1288    log_msg(1, "chdir(%s)", bkpinfo->tmpdir);
     1289    log_to_screen("Extracting filelist and biggielist from media...");
     1290    unlink("/tmp/filelist.full");
     1291    unlink("/" FILELIST_FULL_STUB);
     1292    unlink("/tmp/i-want-my-lvm");
     1293    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
     1294        sprintf(command,
    12951295            "tar -b %ld -zxf %s %s %s %s %s %s",
    12961296            bkpinfo->internal_tape_block_size,
     
    13001300            FILELIST_FULL_STUB,
    13011301            "./tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);
    1302     log_msg(1, "tarcommand = %s", command);
    1303     run_program_and_log_output(command, 1);
    1304 } else {
    1305     log_msg(2,
     1302        log_msg(1, "tarcommand = %s", command);
     1303        run_program_and_log_output(command, 1);
     1304    } else {
     1305        log_msg(2,
    13061306            "Calling insist_on_this_cd_number; bkpinfo->isodir=%s",
    13071307            bkpinfo->isodir);
    1308     insist_on_this_cd_number(1);
    1309     log_msg(2, "Back from iotcn");
    1310     run_program_and_log_output("mount", 1);
    1311     sprintf(command,
     1308        insist_on_this_cd_number(1);
     1309        log_msg(2, "Back from iotcn");
     1310        run_program_and_log_output("mount", 1);
     1311        sprintf(command,
    13121312            "tar -zxf %s/images/all.tar.gz %s %s %s %s %s",
    13131313            MNT_CDROM,
     
    13171317            "./tmp/i-want-my-lvm", MONDO_CFG_FILE_STUB);
    13181318
    1319     log_msg(1, "tarcommand = %s", command);
    1320     run_program_and_log_output(command, 1);
    1321 //    popup_and_OK("Press ENTER to continue");
    1322     if (!does_file_exist(BIGGIELIST_TXT_STUB)) {
    1323         fatal_error
    1324             ("all.tar.gz did not include ./tmp/biggielist.txt");
    1325     }
    1326     if (!does_file_exist(FILELIST_FULL_STUB)) {
    1327         fatal_error
    1328             ("all.tar.gz did not include ./tmp/filelist.full.gz");
    1329     }
    1330 }
    1331 sprintf(command, "cp -f %s %s", MONDO_CFG_FILE_STUB,
     1319        log_msg(1, "tarcommand = %s", command);
     1320        run_program_and_log_output(command, 1);
     1321        if (!does_file_exist(BIGGIELIST_TXT_STUB)) {
     1322            fatal_error
     1323                ("all.tar.gz did not include ./tmp/biggielist.txt");
     1324        }
     1325        if (!does_file_exist(FILELIST_FULL_STUB)) {
     1326            fatal_error
     1327                ("all.tar.gz did not include ./tmp/filelist.full.gz");
     1328        }
     1329    }
     1330    sprintf(command, "cp -f %s %s", MONDO_CFG_FILE_STUB,
    13321331        g_mondo_cfg_file);
    1333 run_program_and_log_output(command, FALSE);
    1334 
    1335 sprintf(command, "cp -f %s/%s %s", bkpinfo->tmpdir,
     1332    run_program_and_log_output(command, FALSE);
     1333
     1334    sprintf(command, "cp -f %s/%s %s", bkpinfo->tmpdir,
    13361335        BIGGIELIST_TXT_STUB, g_biggielist_txt);
    1337 log_msg(1, "command = %s", command);
    1338 paranoid_system(command);
    1339 sprintf(command, "ln -sf %s/%s %s", bkpinfo->tmpdir,
     1336    log_msg(1, "command = %s", command);
     1337    paranoid_system(command);
     1338    sprintf(command, "ln -sf %s/%s %s", bkpinfo->tmpdir,
    13401339        FILELIST_FULL_STUB, g_filelist_full);
    1341 log_msg(1, "command = %s", command);
    1342 paranoid_system(command);
    1343 }
    1344 
    1345 if (am_I_in_disaster_recovery_mode()
    1346 &&
    1347 ask_me_yes_or_no("Do you want to retrieve the mountlist as well?"))
    1348 {
     1340    log_msg(1, "command = %s", command);
     1341    paranoid_system(command);
     1342    }
     1343
     1344    if (am_I_in_disaster_recovery_mode()
     1345    &&
     1346    ask_me_yes_or_no("Do you want to retrieve the mountlist as well?"))
     1347    {
    13491348//      sprintf(command, "cp -f tmp/mountlist.txt /tmp");
    1350 sprintf(command, "ln -sf %s/%s /tmp", MOUNTLIST_FNAME_STUB,
    1351         bkpinfo->tmpdir);
    1352 paranoid_system(command);
    1353 }
    1354 
    1355 chdir(tmp);
    1356 
    1357 if (!does_file_exist(g_biggielist_txt)) {
    1358 log_msg(1, "Warning - %s not found", g_biggielist_txt);
    1359 }
    1360 if (!does_file_exist(g_filelist_full)) {
    1361 log_msg(1, "Warning - %s does not exist", g_filelist_full);
    1362 }
     1349        sprintf(command, "ln -sf %s/%s /tmp", MOUNTLIST_FNAME_STUB,
     1350            bkpinfo->tmpdir);
     1351    paranoid_system(command);
     1352    }
     1353
     1354    chdir(tmp);
     1355   
     1356    if (!does_file_exist(g_biggielist_txt)) {
     1357        log_msg(1, "Warning - %s not found", g_biggielist_txt);
     1358    }
     1359    if (!does_file_exist(g_filelist_full)) {
     1360        log_msg(1, "Warning - %s does not exist", g_filelist_full);
     1361    }
    13631362//  popup_and_OK("Wonderful.");
    13641363
    1365 log_msg(2, "Forking");
    1366 pid = fork();
    1367 switch (pid) {
    1368 case -1:
    1369 fatal_error("Forking error");
    1370 break;
    1371 
    1372 case 0:
    1373 log_to_screen("Pre-processing filelist");
    1374 if (!does_file_exist(g_biggielist_txt)) {
     1364    log_msg(2, "Forking");
     1365    pid = fork();
     1366    switch (pid) {
     1367    case -1:
     1368        fatal_error("Forking error");
     1369        break;
     1370
     1371    case 0:
     1372        log_to_screen("Pre-processing filelist");
     1373        if (!does_file_exist(g_biggielist_txt)) {
    13751374            sprintf(command, "echo -n > %s", g_biggielist_txt);
    13761375            paranoid_system(command);
  • branches/2.2.7/mondo/src/mondorestore/mondorestore.c

    r1969 r1987  
    964964        strcpy(bkpinfo->restore_path, old_restpath);
    965965    } else {
    966         retval += restore_everything(NULL);
     966        if (filelist != NULL) {
     967            retval += restore_everything(NULL);
     968        }
    967969    }
    968970    if (IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) {
Note: See TracChangeset for help on using the changeset viewer.