Changeset 2715 in MondoRescue
- Timestamp:
- Feb 2, 2011, 1:18:23 PM (14 years ago)
- Location:
- branches/2.2.10
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mindi/mindi
r2708 r2715 222 222 223 223 mkdir -p $bigdir/etc 224 tar cf - -C / $mappath 2>> $MINDI_TMP/$$.log | (cd $bigdir; tar xf -) || LogAll "AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log224 tar cf - -C / $mappath 2>> $MINDI_TMP/$$.log | (cd "$bigdir" ; tar xf -) || LogAll "AKMF -- Could not copy $mappath to $bigdir" $MINDI_TMP/$$.log 225 225 if [ "`echo $mappath | grep -F ".gz"`" ] ; then 226 226 included_list=`gzip -dc $mappath | grep -Fi include | sed s/'"'// | sed s/'"'// | cut -d' ' -f2` … … 266 266 find $incoming/* -maxdepth 0 2> /dev/null | CopyDependenciesToDirectory $outdir 0 267 267 elif [ -e "$incoming" ] && [ $found = "false" ]; then 268 tar cf - -C / $incoming 2>> $MINDI_TMP/$$.log | (cd $outdir; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?" $MINDI_TMP/$$.log268 tar cf - -C / $incoming 2>> $MINDI_TMP/$$.log | (cd "$outdir" ; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?" $MINDI_TMP/$$.log 269 269 270 270 # Only uncompress modules if not using udevd … … 468 468 fi 469 469 # Find all files and links (required for some VMWare VMs) 470 modpaths=`find $1-name $2.*o -o -name $2.o.gz -o -name $2.ko.gz -o -name $2 -type f -o -type l`470 modpaths=`find "$1" -name $2.*o -o -name $2.o.gz -o -name $2.ko.gz -o -name $2 -type f -o -type l` 471 471 echo "$modpaths" 472 472 } … … 580 580 LogAll "\nIncorporating post-nuke tarball" 581 581 old_pwd=`pwd` 582 cd $bigdir582 cd "$bigdir" 583 583 tar -zxf $MINDI_TMP/post-nuke.tgz 2>> $MINDI_TMP/$$.log || LogAll "Error occurred when untarring post-nuke tarball" $MINDI_TMP/$$.log 584 cd $old_pwd584 cd "$old_pwd" 585 585 fi 586 586 cp -f $MINDI_TMP/BOOTLOADER.* $bigdir 2>> $LOGFILE || LogAll "\nMondo v1.2x defaults to LILO as the bootloader, BTW." … … 1408 1408 fi 1409 1409 old_pwd=`pwd` 1410 cd $MINDI_TMP/iso1410 cd "$MINDI_TMP/iso" 1411 1411 LogFile "-------------------" 1412 1412 LogFile "Content of the ISO:" … … 1437 1437 fi 1438 1438 rm -f $MINDI_TMP/mkisofs.log 1439 cd $old_pwd1439 cd "$old_pwd" 1440 1440 } 1441 1441 … … 1783 1783 echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n" >> $LOGFILE 1784 1784 [ "$mountpoint" != "" ] && rm -f $mountpoint/vmlinuz 1785 cd $old_pwd1785 cd "$old_pwd" 1786 1786 umount $mountpoint || Die "Cannot unmount mountpoint ($mountpoint)" 1787 1787 rmdir $mountpoint || LogAll "Cannot rmdir (PBDI)" … … 1894 1894 1895 1895 old_pwd=`pwd` 1896 cd $bigdir1896 cd "$bigdir" 1897 1897 1898 1898 # Get terminfo content … … 1909 1909 tar cf - -C / ./lib/dev-state 2>> $MINDI_TMP/$$.log | tar xf - || LogAll "Unable to handle /lib/dev-state" $MINDI_TMP/$$.log 1910 1910 fi 1911 cd $old_pwd1911 cd "$old_pwd" 1912 1912 echo -e "$DONE" 1913 1913 TOTAL_BIGDIR_SIZE=`du -sk $bigdir | cut -f1` … … 1929 1929 echo -en "Tarring and zipping the data content..." 1930 1930 size_of_all_tools=`du -sk $bigdir | cut -f1` 1931 (cd $bigdir; tar -b 4096 -cf - . 2>> $MINDI_TMP/$$.log | gzip -9 > $imagesdir/all.tar.gz || LogAll "Problem creating all.tar.gz" $MINDI_TMP/$$.log)1931 (cd "$bigdir" ; tar -b 4096 -cf - . 2>> $MINDI_TMP/$$.log | gzip -9 > $imagesdir/all.tar.gz || LogAll "Problem creating all.tar.gz" $MINDI_TMP/$$.log) 1932 1932 LogFile "Size of the data content" 1933 1933 LogFile "------------------------" … … 2340 2340 fi 2341 2341 2342 cd $old_pwd2342 cd "$old_pwd" 2343 2343 if [ _"$MONDO_SHARE" != _"" ]; then 2344 2344 MakeMondoConfigFile $MINDI_CACHE/mondorestore.cfg … … 2403 2403 LogFile "Content of initial ramdisk:" 2404 2404 LogFile "---------------------------" 2405 (cd $mountpoint; ls -Rla ) >> $LOGFILE2405 (cd "$mountpoint" ; ls -Rla ) >> $LOGFILE 2406 2406 LogFile "---------------------------" 2407 2407 … … 2414 2414 LogFile "Creating an $gvFileSystem initrd image..." 2415 2415 # kernel expects linuxrc in ext2 filesystem 2416 ( cd $mountpoint&& ln -sf sbin/init linuxrc )2416 ( cd "$mountpoint" && ln -sf sbin/init linuxrc ) 2417 2417 # unmount loop filesystem and create image file using the standard approach 2418 2418 umount $mountpoint || Die "Cannot unmount $tempfile" … … 2430 2430 which cpio &> /dev/null; [ $? -eq 0 ] || Die "cpio not found. Please install package cpio and try again." 2431 2431 # go into filesystem 2432 cd $mountpoint2432 cd "$mountpoint" 2433 2433 # kernel expects init in cpio filesystem 2434 2434 ln -sf sbin/init init 2435 2435 # create cpio image file and unmount loop filesystem 2436 2436 find . -print | cpio -o -H newc | gzip -9 > $rdz_fname 2> /dev/null 2437 cd $old_pwd2437 cd "$old_pwd" 2438 2438 umount $mountpoint || Die "Cannot unmount $tempfile" 2439 2439 # log that we are done -
branches/2.2.10/mindi/rootfs/README
r1885 r2715 14 14 15 15 To edit the mountlist, type:- 16 # edit-mountlist16 # mondorestore --edit-mountlist 17 17 18 18 The archives can be accessed manually using the afio command, like so:- -
branches/2.2.10/mondo-doc/mondoarchive.8
r2546 r2715 158 158 .TP 159 159 .BI "\-E " "\*(lqpath ...\*(rq" 160 Exclude path(s) from backup. The paths should be separated with a whitespace and surrounded by quotes.160 Exclude path(s) from backup. The paths should be separated with a pipe and surrounded by quotes. 161 161 This is the prefered and recommended option when doing partial archiving. 162 162 Note that mondo automatically excludes removable media (/mnt/floppy, … … 170 170 archived so it won't do what you expect. 171 171 You may also specify full disk device to this option as with \-E 172 \*(lq/dev/sda 172 \*(lq/dev/sda|/dev/cciss/c0d0\*(rq 173 173 174 174 .TP 175 175 .BI "-I " "\*(lqpath ...\*(rq" 176 Include paths(s) in backup. This option is mainly use to perform tests 176 Include paths(s) in backup. The paths should be separated with a pipe and surrounded by quotes. 177 This option is mainly use to perform tests 177 178 in order to reduce the time taken by the archiving operation. 178 179 The default backup path is \*(lq/\*(rq but you may specify alternatives, 179 e.g. \-I \*(lq/home 180 e.g. \-I \*(lq/home|/etc\*(rq to override that. 180 181 You may also specify full disk device to this option as with \-I 181 \*(lq/dev/sda 182 \*(lq/dev/sda|/dev/cciss/c0d0\*(rq 182 183 N.B.: When using the 183 184 .BR \-I -
branches/2.2.10/mondo-doc/mondorescue-howto.sgml
r2623 r2715 1334 1334 <entry> 1335 1335 1336 bash# mondoarchive -E "/mnt/dos 1336 bash# mondoarchive -E "/mnt/dos|/mnt/cdrom" -9 -Oc 8 1337 1337 1338 1338 </entry> … … 1561 1561 1562 1562 # mondoarchive -D -Ow 10 -S /home/mondo/ -T /home/mondo/ -g \ 1563 -E " \"/home/cdaly/GIS/W2K /home/mondo/\"" -91563 -E "/home/cdaly/GIS/W2K|/home/mondo" -9 1564 1564 1565 1565 </entry> … … 1575 1575 # at now + 5 min 1576 1576 mondoarchive -D -Ow 10 -S /home/mondo/ -T /home/mondo/ -g \ 1577 -E " \"/home/cdaly/GIS/W2K /home/mondo/\"" -91577 -E "/home/cdaly/GIS/W2K|/home/mondo" -9 1578 1578 <CTRL>-d 1579 1579 </entry> … … 1653 1653 } 1654 1654 screen -m -d mondoarchive -D -Ow 10 -S /home/mondo/ \ 1655 -T /home/mondo/ -g -E " \"/home/cdaly/GIS/W2K /home/mondo/\"" -91655 -T /home/mondo/ -g -E "/home/cdaly/GIS/W2K|/home/mondo" -9 1656 1656 #done 1657 1657 … … 1663 1663 <row> 1664 1664 <entry> 1665 screen -m -d mondoarchive -D -Ow 10 -S /home/mondo/ -T /home/mondo/ -g -E " \"/home/cdaly/GIS/W2K /home/mondo/\"" -91665 screen -m -d mondoarchive -D -Ow 10 -S /home/mondo/ -T /home/mondo/ -g -E "/home/cdaly/GIS/W2K|/home/mondo" -9 1666 1666 </entry> 1667 1667 </row> -
branches/2.2.10/mondo-doc/mondorestore.8
r2546 r2715 87 87 .TP 88 88 .BI "-E " "\*(lqpath ...\*(rq" 89 Exclude path(s) from restore (future dev). The paths should be separated with a whitespace.90 /mnt/cdrom, /proc, /sys, /tmp).For example, if you are restoring up89 Exclude path(s) from restore (future dev). The paths should be separated with a pipe. 90 For example, if you are restoring up 91 91 from an NFS mount but you do not want to restore some content, exclude it with that switch. 92 92 -
branches/2.2.10/mondo/src/common/libmondo-cli.c
r2704 r2715 268 268 /* Cut the flag_val['I'] in parts containing all paths to test them */ 269 269 while (p != NULL) { 270 q = strchr(p, ' 270 q = strchr(p, '|'); 271 271 if (q != NULL) { 272 272 *q = '\0'; … … 590 590 /* Cut the flag_val['E'] in parts containing all paths to test them */ 591 591 while (p != NULL) { 592 q = strchr(p, ' 592 q = strchr(p, '|'); 593 593 if (q != NULL) { 594 594 *q = '\0'; … … 625 625 if ((flag_set['N']) && (! bkpinfo->restore_data)) // exclude Network mounts & devices 626 626 { 627 mr_asprintf(psz, "%s", list_of_NETFS_mounts_only()); 628 mr_strcat(bkpinfo->exclude_paths, " %s ", psz); 629 mr_free(psz); 627 psz = list_of_NETFS_mounts_only(); 628 log_msg(5, "-N means we'll exclude %s", psz); 629 if (bkpinfo->exclude_paths) { 630 mr_strcat(bkpinfo->exclude_paths, "|%s", psz); 631 mr_free(psz); 632 } else { 633 bkpinfo->exclude_paths = psz; 634 } 630 635 631 636 if (bkpinfo->exclude_paths != NULL) { -
branches/2.2.10/mondo/src/common/libmondo-devices-EXT.h
r2508 r2715 46 46 extern int eject_device(char *); 47 47 48 extern char *list_of_NETFS_devices_and_mounts();49 48 extern char *list_of_NETFS_mounts_only(void); 50 49 -
branches/2.2.10/mondo/src/common/libmondo-devices.c
r2704 r2715 1956 1956 log_msg (4, "%s is mounted on %s and is on disk %s", DSFptr->device, DSFptr->mount_point, ndsf); 1957 1957 strcat(*included_dsf_list, DSFptr->mount_point); 1958 strcat(*included_dsf_list, " 1958 strcat(*included_dsf_list, "|"); 1959 1959 } else { 1960 1960 log_msg (4, "%s is mounted on %s and is NOT on disk %s", DSFptr->device, DSFptr->mount_point, ndsf); 1961 1961 strcat(*excluded_dsf_list, DSFptr->mount_point); 1962 strcat(*excluded_dsf_list, " 1962 strcat(*excluded_dsf_list, "|"); 1963 1963 } 1964 1964 DSFptr = DSFptr->next; … … 1980 1980 char *mounted_on_dsf = NULL; 1981 1981 char *not_mounted_on_dsf = NULL; 1982 char token_chars[] =" 1982 char token_chars[] ="|\t\r\f\a\0\n"; 1983 1983 char *tmp = NULL; 1984 1984 char *tmp1 = NULL; … … 2001 2001 log_to_screen("==> %s", mounted_on_dsf); 2002 2002 log_msg (5, "Adding to bkpinfo->exclude_paths due to -E option: %s", mounted_on_dsf); 2003 mr_strcat(bkpinfo->exclude_paths, " %s ", mounted_on_dsf); 2004 mr_strcat(bkpinfo->exclude_devs, " %s ", token); 2003 if (bkpinfo->exclude_paths) { 2004 mr_strcat(bkpinfo->exclude_paths,"|%s",mounted_on_dsf); 2005 } else { 2006 mr_asprintf(bkpinfo->exclude_paths,"%s",mounted_on_dsf); 2007 } 2008 if (bkpinfo->exclude_devs) { 2009 mr_strcat(bkpinfo->exclude_devs,"|%s",token); 2010 } else { 2011 mr_asprintf(bkpinfo->exclude_devs,"%s",token); 2012 } 2005 2013 } 2006 2014 } else { … … 2013 2021 log_to_screen("Not archiving the following file systems:"); 2014 2022 log_to_screen("==> %s", not_mounted_on_dsf); 2015 mr_strcat(bkpinfo->exclude_paths, " %s ", not_mounted_on_dsf); 2023 if (bkpinfo->exclude_paths) { 2024 mr_strcat(bkpinfo->exclude_paths, "|%s",not_mounted_on_dsf); 2025 } else { 2026 mr_asprintf(bkpinfo->exclude_paths,"%s",not_mounted_on_dsf); 2027 } 2016 2028 } 2017 2029 } … … 2023 2035 /* A device special file was not passed in. Process it as a path. */ 2024 2036 case -1: 2025 /* we need to add a space after token to be sure our strstr test works correctly*/2026 mr_asprintf(tmp1," %s",token);2037 /* Adds a | to ensure correct detection even at both ends */ 2038 mr_asprintf(tmp1,"|%s",token); 2027 2039 if (mode == 'E') { 2028 2040 /* Add the token if not already in the list */ 2029 mr_asprintf(tmp," %s",bkpinfo->exclude_paths);2041 mr_asprintf(tmp,"|%s|",bkpinfo->exclude_paths); 2030 2042 if (strstr(tmp,tmp1) == NULL) { 2031 mr_strcat(bkpinfo->exclude_paths, "%s", tmp1); 2043 if (bkpinfo->exclude_paths) { 2044 mr_strcat(bkpinfo->exclude_paths,tmp1); 2045 mr_free(tmp1); 2046 } else { 2047 bkpinfo->exclude_paths = tmp1; 2048 } 2032 2049 } 2033 2050 } else { 2034 2051 /* Add the token if not already in the list */ 2035 mr_asprintf(tmp," %s",bkpinfo->include_paths);2052 mr_asprintf(tmp,"|%s|",bkpinfo->include_paths); 2036 2053 if (strstr(tmp,tmp1) == NULL) { 2037 2054 mr_strcat(bkpinfo->include_paths, "%s", tmp1); 2038 2055 } 2056 mr_free(tmp1); 2039 2057 } 2040 2058 mr_free(tmp); 2041 mr_free(tmp1);2042 2059 break; 2043 2060 } … … 2045 2062 2046 2063 if (bkpinfo->include_paths != NULL) { 2047 mr_strip_spaces(bkpinfo->include_paths);2048 2064 log_msg(1, "include_paths is now '%s'", bkpinfo->include_paths); 2049 2065 } 2050 2066 if (bkpinfo->exclude_paths != NULL) { 2051 mr_strip_spaces(bkpinfo->exclude_paths);2052 2067 log_msg(1, "exclude_paths is now '%s'", bkpinfo->exclude_paths); 2053 2068 } 2054 2069 if (bkpinfo->exclude_devs != NULL) { 2055 mr_strip_spaces(bkpinfo->exclude_devs);2056 2070 log_msg(1, "exclude_devs is now '%s'", bkpinfo->exclude_devs); 2057 2071 } … … 2061 2075 2062 2076 /** 2063 * @addtogroup utilityGroup 2064 * @{ 2065 */ 2066 /** 2067 * Get a space-separated list of NETFS devices and mounts. 2077 * Get a |-separated list of NETFS mounts. 2068 2078 * @return The list created. 2069 * @note The return value points to static data that will be overwritten with each call.2070 * /2071 char *list_of_NETFS_devices_and_mounts(void) 2072 { 2073 char *exclude_these_devices = NULL; 2079 * @note The return value points to allocated string that needs to be freed 2080 * @bug Even though we only want the mounts, the devices are still checked. 2081 */ 2082 char *list_of_NETFS_mounts_only(void) 2083 { 2074 2084 char *exclude_these_directories = NULL; 2075 static char result_sz[1024]; 2076 2077 mr_asprintf(exclude_these_directories,"%s",list_of_NETFS_mounts_only()); 2078 exclude_these_devices = call_program_and_get_last_line_of_output("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs|sshfs|nfs|nfs4|smbfs|cifs|afs|gfs|ocfs|ocfs2|mvfs|nsspool|nsvol) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'",TRUE); 2079 snprintf(result_sz, 1023, "%s %s", exclude_these_directories, exclude_these_devices); 2080 mr_free(exclude_these_devices); 2081 mr_free(exclude_these_directories); 2082 return (result_sz); 2083 } 2084 2085 2086 2087 2088 /** 2089 * Get a space-separated list of NETFS mounts. 2090 * @return The list created. 2091 * @note The return value points to static data that will be overwritten with each call. 2092 * @bug Even though we only want the mounts, the devices are still checked. 2093 */ 2094 char *list_of_NETFS_mounts_only(void) 2095 { 2096 char *exclude_these_directories = NULL; 2097 static char result_sz[512]; 2098 2099 exclude_these_directories = call_program_and_get_last_line_of_output("mount -t coda,ncpfs,fuse.sshfs,nfs,nfs4,smbfs,cifs,afs,gfs,ocfs,ocfs2,mvfs,nsspool,nssvol | tr -s '\t' ' ' | cut -d' ' -f3 | tr -s '\n' ' ' | awk '{print $0;}'",TRUE); 2100 snprintf(result_sz, 511, "%s", exclude_these_directories); 2101 mr_free(exclude_these_directories); 2102 return (result_sz); 2085 2086 exclude_these_directories = call_program_and_get_last_line_of_output("mount -t coda,ncpfs,fuse.sshfs,nfs,nfs4,smbfs,cifs,afs,gfs,ocfs,ocfs2,mvfs,nsspool,nssvol | tr -s '\t' ' ' | cut -d' ' -f3 | tr -s '\n' '|' | awk '{print $0;}'",TRUE); 2087 log_msg(9,"list_of_NETFS_mounts_only returns %s\n",exclude_these_directories); 2088 return(exclude_these_directories); 2103 2089 } 2104 2090 … … 3106 3092 bkpinfo->include_paths = p; 3107 3093 3108 p = popup_and_get_string("Backup paths", "Please enter paths which you want me to backup . The default is '/' (i.e. everything).", bkpinfo->include_paths);3094 p = popup_and_get_string("Backup paths", "Please enter paths which you want me to backup separated by '|'. The default is '/' (i.e. everything).", bkpinfo->include_paths); 3109 3095 if (p == NULL) { 3110 3096 log_to_screen("User has chosen not to backup the PC"); … … 3114 3100 bkpinfo->include_paths = p; 3115 3101 3116 mr_asprintf(tmp, "%s", list_of_NETFS_mounts_only());3102 tmp = list_of_NETFS_mounts_only(); 3117 3103 if (strlen(tmp) > 2) { 3118 mr_strcat(bkpinfo->exclude_paths, " 3104 mr_strcat(bkpinfo->exclude_paths, "|%s",tmp); 3119 3105 } 3120 3106 mr_free(tmp); … … 3133 3119 3134 3120 3135 p = popup_and_get_string("Exclude paths", "Please enter paths which you do NOT want to backup. Separate them with spaces. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup.", bkpinfo->exclude_paths);3121 p = popup_and_get_string("Exclude paths", "Please enter paths which you do NOT want to backup. Separate them with pipes. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup.", bkpinfo->exclude_paths); 3136 3122 if (p == NULL) { 3137 3123 log_to_screen("User has chosen not to backup the PC"); … … 3140 3126 mr_free(bkpinfo->exclude_paths); 3141 3127 bkpinfo->exclude_paths = p; 3142 /* Always needs to be finished by a space */3143 mr_strcat(bkpinfo->exclude_paths, " 3128 /* Always needs to be finished by a pipe */ 3129 mr_strcat(bkpinfo->exclude_paths, "|"); 3144 3130 3145 3131 p = popup_and_get_string("Temporary directory", "Please enter your temporary directory.", bkpinfo->tmpdir); … … 3217 3203 /* the mr_make_devlist_from_pathlist function appends 3218 3204 * to the *_paths variables so copy before */ 3219 mr_asprintf(tmp, "%s 3205 mr_asprintf(tmp, "%s|", bkpinfo->exclude_paths); 3220 3206 mr_make_devlist_from_pathlist(tmp, 'E'); 3221 3207 mr_free(tmp); 3222 mr_asprintf(tmp, "%s 3208 mr_asprintf(tmp, "%s|", bkpinfo->include_paths); 3223 3209 mr_make_devlist_from_pathlist(tmp, 'I'); 3224 3210 mr_free(tmp); -
branches/2.2.10/mondo/src/common/libmondo-devices.h
r2508 r2715 38 38 int eject_device(char *); 39 39 40 char *list_of_NETFS_devices_and_mounts();41 40 char *list_of_NETFS_mounts_only(); 42 41 -
branches/2.2.10/mondo/src/common/libmondo-filelist.c
r2704 r2715 1283 1283 mr_asprintf(sz_res, "%s", incoming); 1284 1284 p = sz_res; 1285 while ((*p != ' 1285 while ((*p != '|' || in_quotes) && *p != '\0') { 1286 1286 if (*p == '\"') { 1287 1287 in_quotes = !in_quotes; … … 1311 1311 int open_and_list_dir(char *dir1, char *sth, FILE * fout, time_t time_of_last_full_backup) { 1312 1312 1313 const char delims[] = " 1313 const char delims[] = "|"; 1314 1314 1315 1315 DIR *dip; … … 1322 1322 static int percentage = 0; 1323 1323 char *skip_these = NULL; 1324 char *new_with_ spaces = NULL;1324 char *new_with_pipe; 1325 1325 char *strtmp; 1326 1326 char *token; … … 1347 1347 } 1348 1348 } 1349 mr_asprintf(&find_excludes, "|"); 1349 1350 1350 1351 if (!depth) { 1351 mr_asprintf(find_excludes, " 1352 mr_asprintf(find_excludes, "|"); 1352 1353 if (sth != NULL) { 1353 1354 while((token = mr_strtok(sth, delims, &lastpos))) { … … 1417 1418 1418 1419 // log_msg(0, "Cataloguing %s", dir); 1419 if (sth[0] == ' ') { 1420 mr_asprintf(skip_these, "%s", sth); 1421 } else { 1422 mr_asprintf(skip_these, " %s ", sth); 1423 } 1424 mr_asprintf(new_with_spaces, " %s ", dir1); 1420 mr_asprintf(skip_these, "|%s|", sth); 1421 mr_asprintf(new_with_pipe, "|%s|", dir1); 1425 1422 if ((dip = opendir(dir1)) == NULL) { 1426 1423 mr_asprintf(tmp,"opendir %s", dir1); 1427 1424 log_OS_error(tmp); 1428 1425 mr_free(tmp); 1429 } else if (strstr(skip_these, new_with_ spaces)) {1426 } else if (strstr(skip_these, new_with_pipe)) { 1430 1427 log_msg(10, "Found dir ***%s**** excluded", dir1); 1431 1428 fprintf(fout, "%s\n", dir1); // if excluded dir then print dir ONLY … … 1440 1437 mr_asprintf(new,"%s%s",dir1,dit->d_name); 1441 1438 } 1442 mr_free(new_with_ spaces);1443 mr_asprintf(new_with_spaces, " %s", new);1444 if (strstr(skip_these, new_with_ spaces)) {1439 mr_free(new_with_pipe); 1440 mr_asprintf(new_with_spaces, "|%s|", new); 1441 if (strstr(skip_these, new_with_pipe)) { 1445 1442 fprintf(fout, "%s\n", new); 1446 1443 log_msg(10, "Found child dir ***%s**** excluded", new); 1447 mr_free(new_with_ spaces);1444 mr_free(new_with_pipe); 1448 1445 } else { 1449 mr_free(new_with_ spaces);1446 mr_free(new_with_pipe); 1450 1447 if (!lstat(new, &statbuf)) { 1451 1448 if (!S_ISLNK(statbuf.st_mode) … … 1474 1471 } 1475 1472 } 1476 mr_free(new_with_ spaces);1473 mr_free(new_with_pipe); 1477 1474 mr_free(skip_these); 1478 1475 mr_free(dir); … … 1584 1581 mr_free(tmp1); 1585 1582 1586 mr_asprintf(exclude_paths, " %s %s %s %s %s . .. " MNT_CDROM " " MNT_FLOPPY " /media /tmp /proc /sys /dev/shm " MINDI_CACHE, MONDO_CACHE, (excp == NULL) ? "" : excp, tmp2, (bkpinfo->tmpdir[0] == '/' && bkpinfo->tmpdir[1] == '/') ? (bkpinfo->tmpdir + 1) : bkpinfo->tmpdir, (bkpinfo->scratchdir[0] == '/' && bkpinfo->scratchdir[1] == '/') ? (bkpinfo->scratchdir + 1) : bkpinfo->scratchdir); 1587 mr_free(tmp2); 1583 mr_asprintf(exclude_paths, MONDO_CACHE"|%s|%s|%s|%s|.|..|"MNT_CDROM"|"MNT_FLOPPY"|/media|/tmp|/proc|/sys|/dev/shm|"MINDI_CACHE,(excp == NULL) ? "" : excp, tmp2, (bkpinfo->tmpdir[0] == '/' && bkpinfo->tmpdir[1] == '/') ? (bkpinfo->tmpdir + 1) : bkpinfo->tmpdir, (bkpinfo->scratchdir[0] == '/' && bkpinfo->scratchdir[1] == '/') ? (bkpinfo->scratchdir + 1) : bkpinfo->scratchdir); 1588 1584 1589 1585 log_msg(2, "Excluding paths = '%s'", exclude_paths); … … 1610 1606 p += strlen(q); 1611 1607 paranoid_free(q); 1612 while (*p == ' 1608 while (*p == '|') { 1613 1609 p++; 1614 1610 }
Note:
See TracChangeset
for help on using the changeset viewer.