Changeset 3882 in MondoRescue for branches/3.3/mondo/src/mondorestore
- Timestamp:
- Mar 10, 2024, 12:46:53 AM (2 years ago)
- Location:
- branches/3.3/mondo/src/mondorestore
- Files:
-
- 4 edited
-
mondo-rstr-compare-EXT.h (modified) (1 diff)
-
mondo-rstr-compare.c (modified) (2 diffs)
-
mondo-rstr-tools.c (modified) (2 diffs)
-
mondorestore.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mondo/src/mondorestore/mondo-rstr-compare-EXT.h
r1647 r3882 3 3 4 4 extern int compare_to_CD(); 5 extern int compare_to_cdstream();6 5 extern int compare_to_tape(); 7 6 extern int compare_mode(struct mountlist_itself *mountlist, -
branches/3.3/mondo/src/mondorestore/mondo-rstr-compare.c
r3879 r3882 555 555 556 556 /** 557 * Compare all data on a cdstream-based backup.558 * @param bkpinfo The backup information structure. Fields used:559 * - @c bkpinfo->disaster_recovery560 * - @c bkpinfo->media_device561 * - @c bkpinfo->restore_path562 * @return 0 for success, nonzero for failure.563 */564 int compare_to_cdstream()565 {566 int res;567 568 /** needs malloc **/569 char *dir;570 char *command = NULL;571 572 assert(bkpinfo != NULL);573 malloc_string(dir);574 if (getcwd(dir, MAX_STR_LEN)) {575 // FIXME576 }577 if (chdir(bkpinfo->restore_path)) {578 // FIXME579 }580 581 mr_asprintf(command, "cp -f /tmp/LAST-FILELIST-NUMBER %s/tmp", bkpinfo->restore_path);582 run_program_and_log_output(command, FALSE);583 mr_free(command);584 mvaddstr_and_log_it(g_currentY, 0, "Verifying archives against filesystem");585 586 if (bkpinfo->disaster_recovery587 && does_file_exist("/tmp/CDROM-LIVES-HERE")) {588 mr_asprintf(bkpinfo->media_device, "%s", last_line_of_file("/tmp/CDROM-LIVES-HERE"));589 } else {590 bkpinfo->media_device = find_optical_device();591 }592 res = verify_tape_backups();593 if (chdir(dir)) {594 // FIXME595 }596 if (length_of_file(MONDO_CACHE"/changed.txt") > 2597 && length_of_file(MONDO_CACHE"/changed.files") > 2) {598 log_msg(0,599 "Type 'less "MONDO_CACHE"/changed.files' to see which files don't match the archives");600 log_msg(2, "Calling popup_changelist_from_file()");601 popup_changelist_from_file(MONDO_CACHE"/changed.files");602 log_msg(2, "Returned from popup_changelist_from_file()");603 }604 605 mvaddstr_and_log_it(g_currentY++, 74, "Done.");606 paranoid_free(dir);607 return (res);608 }609 610 /**************************************************************************611 *END_COMPARE_CD_STREAM *612 **************************************************************************/613 614 615 616 /**617 557 * Compare all data in the user's backup. 618 558 * This function will mount filesystems, compare afioballs and biggiefiles, … … 682 622 || bkpinfo->backup_media_type == udev) { 683 623 retval += compare_to_tape(); 684 } else if (bkpinfo->backup_media_type == cdstream) {685 retval += compare_to_cdstream();686 624 } else { 687 625 retval += compare_to_CD(); -
branches/3.3/mondo/src/mondorestore/mondo-rstr-tools.c
r3881 r3882 940 940 941 941 if (0 == read_cfg_var(cfg_file, "backup-media-type", value)) { 942 if (!strcmp(value, "cdstream")) { 943 bkpinfo->backup_media_type = cdstream; 944 } else if (!strcmp(value, "optical")) { 942 if (!strcmp(value, "optical")) { 945 943 bkpinfo->backup_media_type = optical; 946 944 } else if (!strcmp(value, "usb")) { … … 1008 1006 1009 1007 if (bkpinfo->disaster_recovery) { 1010 if (bkpinfo->backup_media_type == cdstream) { 1011 mr_asprintf(bkpinfo->media_device, "%s", "/dev/cdrom"); 1012 bkpinfo->media_size = 650; /* good guess */ 1013 } else if (bkpinfo->backup_media_type == usb) { 1008 if (bkpinfo->backup_media_type == usb) { 1014 1009 envtmp1 = getenv("MRUSBDEV"); 1015 1010 if (envtmp1 == NULL) { -
branches/3.3/mondo/src/mondorestore/mondorestore.c
r3879 r3882 673 673 /** 674 674 * Restore @p tarball_fname from CD. 675 * @param tarball_fname The filename of the tarball to restore (in /mnt/cdrom).675 * @param tarball_fname The filename of the tarball to restore (in MNT_CDROM). 676 676 * This will be used unmodified. 677 677 * @param current_tarball_number The number (starting from 0) of the fileset … … 1800 1800 mvaddstr_and_log_it(g_currentY++, 0, 1801 1801 "Restoring OS and data from streaming media"); 1802 if (bkpinfo->backup_media_type == cdstream) { 1803 openin_cdstream(); 1804 } else { 1805 assert_string_is_neither_NULL_nor_zerolength(bkpinfo->media_device); 1806 openin_tape(); 1807 } 1802 assert_string_is_neither_NULL_nor_zerolength(bkpinfo->media_device); 1803 openin_tape(); 1808 1804 resA = restore_all_tarballs_from_stream(filelist); 1809 1805 resB = restore_all_biggiefiles_from_stream(filelist); 1810 if (bkpinfo->backup_media_type == cdstream) { 1811 closein_cdstream(); 1812 } else { 1813 closein_tape(); 1814 } 1806 closein_tape(); 1815 1807 } else { 1816 1808 mount_media(MNT_CDROM); … … 2332 2324 } else { 2333 2325 popup_and_OK("No restoring or comparing will take place today."); 2334 if (is_this_device_mounted( "/mnt/cdrom")) {2335 run_program_and_log_output("umount -d /mnt/cdrom", FALSE);2326 if (is_this_device_mounted(MNT_CDROM)) { 2327 run_program_and_log_output("umount -d "MNT_CDROM, FALSE); 2336 2328 } 2337 2329 if (g_ISO_restore_mode) { … … 2919 2911 2920 2912 if (!bkpinfo->please_dont_eject) { 2921 (void)eject_device("/dev/cdrom"); 2922 } 2923 mvaddstr_and_log_it(g_currentY++, 2924 0, 2925 "Run complete. Please remove media and reboot."); 2913 (void)eject_device(bkpinfo->backup_media_type); 2914 } 2915 mvaddstr_and_log_it(g_currentY++, 0, "Run complete. Please remove media and reboot."); 2926 2916 } 2927 2917 }
Note:
See TracChangeset
for help on using the changeset viewer.
