Changeset 1966 in MondoRescue
- Timestamp:
- May 29, 2008, 10:38:12 AM (17 years ago)
- Location:
- branches/2.2.6/mondo/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.6/mondo/src/common/libmondo-cli.c
r1948 r1966 787 787 if (flag_set['p']) { 788 788 strncpy(bkpinfo->prefix, flag_val['p'], MAX_STR_LEN / 4); 789 log_msg(1,"Prefix forced to %s",bkpinfo->prefix); 789 790 } 790 791 -
branches/2.2.6/mondo/src/common/libmondo-tools.c
r1946 r1966 848 848 memset((void *) bkpinfo, 0, sizeof(struct s_bkpinfo)); 849 849 850 sensibly_set_tmpdir_and_scratchdir();851 852 bkpinfo->manual_cd_tray = FALSE;853 bkpinfo->internal_tape_block_size = DEFAULT_INTERNAL_TAPE_BLOCK_SIZE;854 850 bkpinfo->media_device[0] = '\0'; 855 851 for (i = 0; i <= MAX_NOOF_MEDIA; i++) { … … 860 856 bkpinfo->zip_exe[0] = '\0'; 861 857 bkpinfo->zip_suffix[0] = '\0'; 862 bkpinfo->restore_path[0] = '\0'; 858 bkpinfo->image_devs[0] = '\0'; 859 bkpinfo->compression_level = 3; 863 860 bkpinfo->use_lzo = FALSE; 864 861 bkpinfo->use_gzip = FALSE; … … 867 864 bkpinfo->backup_data = FALSE; 868 865 bkpinfo->restore_data = FALSE; 866 bkpinfo->use_star = FALSE; 867 bkpinfo->internal_tape_block_size = DEFAULT_INTERNAL_TAPE_BLOCK_SIZE; 869 868 bkpinfo->disaster_recovery = 870 869 (am_I_in_disaster_recovery_mode()? TRUE : FALSE); … … 875 874 } 876 875 strcpy(bkpinfo->prefix, STD_PREFIX); 877 876 sensibly_set_tmpdir_and_scratchdir(); 877 878 bkpinfo->optimal_set_size = 0; 879 strcpy(bkpinfo->include_paths, "/"); 878 880 bkpinfo->make_filelist = TRUE; // unless -J supplied to mondoarchive 879 bkpinfo->optimal_set_size = 0; 880 bkpinfo->backup_media_type = none; 881 strcpy(bkpinfo->include_paths, "/"); 881 bkpinfo->include_paths[0] = '\0'; 882 882 bkpinfo->exclude_paths[0] = '\0'; 883 bkpinfo->restore_path[0] = '\0'; 883 884 bkpinfo->call_before_iso[0] = '\0'; 884 885 bkpinfo->call_make_iso[0] = '\0'; 885 886 bkpinfo->call_burn_iso[0] = '\0'; 886 887 bkpinfo->call_after_iso[0] = '\0'; 887 bkpinfo->image_devs[0] = '\0';888 bkpinfo->postnuke_tarball[0] = '\0';889 888 bkpinfo->kernel_path[0] = '\0'; 890 889 bkpinfo->nfs_mount[0] = '\0'; 891 890 bkpinfo->nfs_remote_dir[0] = '\0'; 891 bkpinfo->postnuke_tarball[0] = '\0'; 892 892 bkpinfo->wipe_media_first = FALSE; 893 bkpinfo->differential = FALSE; 893 bkpinfo->differential = 0; 894 bkpinfo->please_dont_eject = FALSE; 894 895 bkpinfo->cdrw_speed = 0; 895 // patch by Herman Kuster 896 bkpinfo-> differential = 0;897 // patch end 898 bkpinfo-> compression_level = 3;896 bkpinfo->manual_cd_tray = FALSE; 897 bkpinfo->nonbootable_backup = FALSE; 898 bkpinfo->make_cd_use_lilo = FALSE; 899 bkpinfo->use_obdr = FALSE; 899 900 } 900 901 -
branches/2.2.6/mondo/src/mondorestore/mondorestore.c
r1947 r1966 3121 3121 } 3122 3122 3123 if (argc == 3 && strcmp(argv[1], "-p") == 0) {3124 strcpy(bkpinfo->prefix,argv[2]);3125 log_msg(1,"Prefix forced to %s",bkpinfo->prefix);3126 }3127 3128 if (argc == 3 && strcmp(argv[1], "-K") == 0) {3129 g_loglevel = atoi(argv[2]);3130 log_msg(1,"Loglevel forced to %d",g_loglevel);3131 }3132 3133 3123 if (argc == 2 && strcmp(argv[1], "--live-grub") == 0) { 3134 3124 retval = run_grub(FALSE, "/dev/hda"); … … 3142 3132 pause_and_ask_for_cdr(5, NULL); 3143 3133 paranoid_MR_finish(0); 3144 } else if (!bkpinfo->disaster_recovery) { // live! 3145 if (argc != 1) { 3146 popup_and_OK 3147 ("Live mode doesn't support command-line parameters yet."); 3148 paranoid_MR_finish(1); 3149 // return(1); 3150 } 3134 } 3135 if ((argc == 2 && strcmp(argv[1], "--partition-only") == 0) && (bkpinfo->disaster_recovery)) { 3136 log_msg(0, "Partitioning only."); 3137 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 3138 strcpy(g_mountlist_fname, "/tmp/mountlist.txt"); 3139 load_mountlist(mountlist, g_mountlist_fname); 3140 res = partition_everything(mountlist); 3141 finish(res); 3142 } 3143 3144 if ((argc == 2 && strcmp(argv[1], "--format-only") == 0) && (bkpinfo->disaster_recovery)) { 3145 log_msg(0, "Formatting only."); 3146 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 3147 strcpy(g_mountlist_fname, "/tmp/mountlist.txt"); 3148 load_mountlist(mountlist, g_mountlist_fname); 3149 res = format_everything(mountlist, FALSE, raidlist); 3150 finish(res); 3151 } 3152 3153 if ((argc == 2 && strcmp(argv[1], "--stop-lvm-and-raid") == 0) && (bkpinfo->disaster_recovery)) { 3154 log_msg(0, "Stopping LVM and RAID"); 3155 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 3156 strcpy(g_mountlist_fname, "/tmp/mountlist.txt"); 3157 load_mountlist(mountlist, g_mountlist_fname); 3158 res = do_my_funky_lvm_stuff(TRUE, FALSE); 3159 res += stop_all_raid_devices(mountlist); 3160 finish(res); 3161 } 3162 3163 if ((argc > 1 && strcmp(argv[argc - 1], "--live-from-cd") == 0) && (!bkpinfo->disaster_recovery)) { 3164 g_restoring_live_from_cd = TRUE; 3165 } 3166 3167 // Handle params here first 3168 handle_incoming_parameters(argc,argv); 3169 3170 if (!bkpinfo->disaster_recovery) { // live! 3151 3171 log_msg(1, "I am in normal, live mode."); 3152 3172 log_msg(2, "FYI, MOUNTLIST_FNAME = %s", g_mountlist_fname); 3153 3173 mount_boot_if_necessary(); /* for Gentoo users */ 3154 3174 log_msg(2, "Still here."); 3155 if (argc > 1 && strcmp(argv[argc - 1], "--live-from-cd") == 0) {3156 g_restoring_live_from_cd = TRUE;3157 }3158 3175 if (bkpinfo->backup_media_type == nfs) { 3159 3176 g_restoring_live_from_nfs = TRUE; … … 3162 3179 retval = 3163 3180 restore_live_from_monitas_server(argv[2], 3164 3181 argv[3], argv[4]); 3165 3182 } else { 3166 3183 log_msg(2, "Calling restore_to_live_filesystem()"); … … 3178 3195 log_msg(1, "I must be in disaster recovery mode."); 3179 3196 log_msg(2, "FYI, MOUNTLIST_FNAME = %s ", g_mountlist_fname); 3180 if (argc == 3 && strcmp(argv[1], "--monitas-memorex") == 0) {3181 log_to_screen("Uh, that hasn't been implemented yet.");3182 paranoid_MR_finish(1);3183 }3184 3197 3185 3198 iamhere("About to call load_mountlist and load_raidtab"); … … 3191 3204 ("Returned from calling load_mountlist and load_raidtab successfully"); 3192 3205 3206 // BCO:To be reviewed 3193 3207 if (argc > 1 3194 3208 && (strcmp(argv[1], "--compare") == 0 … … 3205 3219 } 3206 3220 3207 3208 3221 if (retval) { 3209 3222 log_to_screen … … 3211 3224 } 3212 3225 3213 3214 3226 log_msg(1, "Send in the clowns."); 3215 3227 3216 if (argc == 2 && strcmp(argv[1], "--partition-only") == 0) {3217 log_msg(0, "Partitioning only.");3218 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);3219 strcpy(g_mountlist_fname, "/tmp/mountlist.txt");3220 load_mountlist(mountlist, g_mountlist_fname);3221 res = partition_everything(mountlist);3222 finish(res);3223 }3224 3225 if (argc == 2 && strcmp(argv[1], "--format-only") == 0) {3226 log_msg(0, "Formatting only.");3227 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);3228 strcpy(g_mountlist_fname, "/tmp/mountlist.txt");3229 load_mountlist(mountlist, g_mountlist_fname);3230 res = format_everything(mountlist, FALSE, raidlist);3231 finish(res);3232 }3233 3234 if (argc == 2 && strcmp(argv[1], "--stop-lvm-and-raid") == 0) {3235 log_msg(0, "Stopping LVM and RAID");3236 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);3237 strcpy(g_mountlist_fname, "/tmp/mountlist.txt");3238 load_mountlist(mountlist, g_mountlist_fname);3239 res = do_my_funky_lvm_stuff(TRUE, FALSE);3240 res += stop_all_raid_devices(mountlist);3241 finish(res);3242 }3243 3228 3244 3229 if (argc == 2 && strcmp(argv[1], "--nuke") == 0) {
Note:
See TracChangeset
for help on using the changeset viewer.