Changeset 914 in MondoRescue


Ignore:
Timestamp:
Nov 2, 2006, 2:00:32 AM (17 years ago)
Author:
Bruno Cornec
Message:

merge -r902:913 $SVN_M/branches/stable

Location:
trunk
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/contrib/mkcd/setup

    r355 r914  
    150150    fi
    151151
    152     res=`cat /etc/issue.net 2>/dev/null | fgrep -i turbolinux | head -n1`
     152    res=`cat /etc/issue.net 2>/dev/null | grep -i turbolinux | head -n1`
    153153    if [ "$res" != "" ] ; then
    154154    echo "$res"
     
    156156    fi
    157157
    158     for fname in `find /etc -maxdepth 1 | fgrep release` /etc/issue.net ; do
    159         res=`cat $fname 2>/dev/null | fgrep -i "linux" | head -n1 | tr -s '\t' ' '`
     158    for fname in `find /etc -maxdepth 1 | grep release` /etc/issue.net ; do
     159        res=`cat $fname 2>/dev/null | grep -i "linux" | head -n1 | tr -s '\t' ' '`
    160160        [ "$res" = "" ] && res=`cat $fname |head -n1 | tr -s '\t' ' '`
    161161        if [ "$res" != "" ] ; then
     
    230230        [ "`echo "$i" | grep mindi`" ] && qq=head || qq=tail
    231231        j=`find $1/ -type f -maxdepth 1 | grep "$i" | $qq -n1`
    232         [ ! "$j" ] && j=`find RPMS/ -type f -maxdepth 1 | fgrep "$i" | $qq -n1`
     232        [ ! "$j" ] && j=`find RPMS/ -type f -maxdepth 1 | grep -F "$i" | $qq -n1`
    233233        if [ ! "$j" ] ; then
    234234        echo "Looking for $i" >> /dev/stderr
     
    254254        if echo "$j" | grep "\-$blah" &> /dev/null ; then
    255255        k=`echo "$j" | cut -d'-' -f1,2`
    256         if echo "$j" | grep -x "[A-Z,a-Z]*-[A-Z,a-Z]*-[A-Z,a-z]*-.*" &> /dev/null ; then
     256        if echo "$j" | grep -E '^[A-Z,a-Z]*-[A-Z,a-Z]*-[A-Z,a-z]*-.*$' &> /dev/null ; then
    257257            k=`echo "$j" | cut -d'-' -f1,2,3`
    258258        fi
     
    279279#    echo "banner = $banner" >> /dev/stderr
    280280    for i in $banner ; do
    281     j=`echo $i | grep -x "[v|V][0-9]+*.*"`
    282     [ ! "$j" ] && j=`echo $i | grep -x "[0-9]+*.*"`
    283     echo "$j" | grep -x "[0-9]*)" > /dev/null && continue
     281    j=`echo $i | grep -E '^[v|V][0-9]+*.*$'`
     282    [ ! "$j" ] && j=`echo $i | grep -E '^[0-9]+*.*$'`
     283    echo "$j" | grep -E '^[0-9]*)$' > /dev/null && continue
    284284    [ "$j" ] && res=`echo $j | sed s/v// | sed s/V//`
    285285    done
     
    610610
    611611StrStr() {
    612   [ "`echo "$1" | fgrep -i "$2"`" ] && return 0 || return 1
     612  [ "`echo "$1" | grep -Fi "$2"`" ] && return 0 || return 1
    613613}
    614614
     
    674674echo -en "Do you want to install the (S)table or the (D)evelopment branch of Mondo? "
    675675read ch
    676 if [ "`echo "development" | fgrep -i "$ch"`" ] ; then
     676if [ "`echo "development" | grep -Fi "$ch"`" ] ; then
    677677    MY_BRANCH=$DEVEL_BRANCH
    678678    MINDI_BRANCH=1.1
     
    703703    echo -en "Shall I do that (y/n)? "
    704704    read ch
    705     if [ "`echo "YESyesYes" | fgrep "$ch"`" ] ; then
     705    if [ "`echo "YESyesYes" | grep -F "$ch"`" ] ; then
    706706        distro=RHT
    707707        version=7.2
  • trunk/mindi/analyze-my-lvm

    r863 r914  
    9494    allocation=`GetValueFromField $fname "LV Size"`
    9595    [ ! "`echo "$allocation" | grep "[k,m,g]"`" ] && allocation="$allocation"m
    96     if echo "$allocation" | grep -x ".*g" > /dev/null 2> /dev/null ; then
     96    if echo "$allocation" | grep -E '^.*g$' > /dev/null 2> /dev/null ; then
    9797        val=`echo "$allocation" | sed s/g//`
    9898        allocation=`echo "$val" | awk '{c=$1; printf "%d", c*1024;}'`m
     
    169169
    170170ListLvmDrivesAndPartitions() {
    171     $LVMCMD vgdisplay -v 2> /dev/null |grep "PV Name" | sed 's/(#)//' | awk '{print $3}'
     171    $LVMCMD vgdisplay -v 2> /dev/null | grep "PV Name" | sed 's/(#)//' | awk '{print $3}'
    172172}
    173173
  • trunk/mindi/aux-tools/sbin/calc-disk-size

    r197 r914  
    2828# ---------------- main ---------------
    2929
    30 if [ "$#" -ne "1" ] || [ "`echo "$1" |grep -x "/dev/[a-z]*"`" = "" ]; then
     30if [ "$#" -ne "1" ] || [ "`echo "$1" |grep -E '^/dev/[a-z]*$'`" = "" ]; then
    3131    LogIt "calc-disk-size <device>" 1
    3232    exit 1
  • trunk/mindi/install.sh

    r904 r914  
    3535
    3636ARCH=`/bin/arch`
    37 echo $ARCH | grep -x "i[0-9]86" &> /dev/null && ARCH=i386 && locallib=$local/lib
    38 echo $ARCH | grep -x "x86_64" &> /dev/null && locallib=$local/lib64
    39 echo $ARCH | grep -x "ia64" &> /dev/null && locallib=$local/lib
     37echo $ARCH | grep -E '^i[0-9]86$' &> /dev/null && ARCH=i386 && locallib=$local/lib
     38echo $ARCH | grep -E '^x86_64$' &> /dev/null && locallib=$local/lib64
     39echo $ARCH | grep -E '^ia64$' &> /dev/null && locallib=$local/lib
    4040export ARCH
    4141
  • trunk/mindi/rootfs/sbin/init

    r904 r914  
    239239        [ -d "/proc/1" ] || mount -n /proc
    240240        LogIt "Kernel support found. Creating config file and starting devfsd"
    241         conffile=`strings $loc | grep "devfsd.conf$"`
     241        conffile=`strings $loc | grep -E "devfsd.conf$"`
    242242        [ "$conffile" ] || conffile="/etc/devfsd.conf"
    243243        confpath=`echo $conffile | sed "s/\/devfsd\.conf$//"`
  • trunk/mondo-doc/mondoarchive.8

    r794 r914  
    105105.B prefix
    106106to generate the name of your ISO images.
    107 By default, mondoarchive calls images mondorescue-1.iso, mondorescue-2.iso, ...
     107By default, mondoarchive names images mondorescue-1.iso, mondorescue-2.iso, ...
    108108Using
    109109.B -p machine
    110 it will call your images machine-1.iso, machine-2.iso, ...
     110will name your images machine-1.iso, machine-2.iso, ...
    111111
    112112.TP
     
    145145Exclude path(s) from backup. The paths should be separated with a whitespace.
    146146Note that mondo automatically excludes removable media (/mnt/floppy,
    147 /mnt/cdrom, etc.). For example, if you are backing up to an NFS mount but you
     147/mnt/cdrom, /proc, /sys, /tmp). For example, if you are backing up to an NFS mount but you
    148148do not want to include the contents of the mount in a backup, exclude your
    149149local mount-point with this switch. It will also work with partitions, e.g.
     
    151151the mountlist. NB: If you exclude /dev/sdd4 then the /dev entry itself will
    152152still be backed up, even though the mountlist entry will be suppressed.
    153 NOTA: If you precise a directory with a final / its content will be archived so it won't do what you expect.
     153N.B.: If you specify a directory with a final / its content will be archived so it won't do what you expect.
    154154
    155155.TP
     
    272272.TP
    273273.BI "-S " "path"
    274 Specify the scratchdir, the directory where ISO images are built before being
     274Specify the full pathname of the scratchdir, the directory where ISO images are built before being
    275275archived. If you have plenty of RAM and want to use a ramdisk for scratch
    276276space, specify its path here.
     
    278278.TP
    279279.BI "-T " "path"
    280 Specify the tempdir, the directory where temporary files (other than ISO images
     280Specify the full pathname of the tempdir, the directory where temporary files (other than ISO images
    281281being assembled) are stored. See
    282282.B -S
     
    320320.TP
    321321.BI "-K " "loglevel"
    322 Specify the loglevel.
     322Specify the loglevel. Use 99 for full debug. Standard debug level is 4.
    323323
    324324
     
    361361for its ISO's unless you exclude it, as follows:-
    362362.br
    363 .I "mondoarchive -Oi -d /mnt/foo -E \"/mnt/foo /mnt/foo2\""
     363.I "mondoarchive -Oi -d /mnt/foo -E \"/mnt/foo /mnt/foo2\" -p `hostname`-`date +%Y-%m-%d`"
    364364
    365365Backup to ISO's non-interactively, e.g. as a job running in /etc/cron.daily:
  • trunk/mondo/src/common/libmondo-archive.c

    r900 r914  
    568568
    569569    mr_asprintf(&tmp,
    570              "echo '%s' | tr -s ' ' '\n' | grep -x '/dev/.*' | tr -s '\n' ' ' | awk '{print $0\"\\n\";}'",
     570             "echo '%s' | tr -s ' ' '\n' | grep -E '^/dev/.*$' | tr -s '\n' ' ' | awk '{print $0\"\\n\";}'",
    571571             bkpinfo->exclude_paths);
    572572    devs_to_exclude = call_program_and_get_last_line_of_output(tmp);
     
    17411741                }
    17421742                pause_for_N_seconds(5, "Letting DVD drive settle");
    1743                 mr_asprintf(&sz_blank_disk, "dvd+rw-format %s",
     1743                mr_asprintf(&sz_blank_disk, "dvd+rw-format -force %s",
    17441744                         bkpinfo->media_device);
    17451745                log_msg(3, "sz_blank_disk = '%s'", sz_blank_disk);
     
    18051805// FIXME --- change mkisofs string to MONDO_MKISOFS_NONBOOTABLE and add ' .' at end
    18061806            res = eval_call_to_make_ISO(bkpinfo,
    1807                                         "mkisofs -o _ISO_ -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .",
     1807                                        "mkisofs -o '_ISO_' -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .",
    18081808                                        destfile, g_current_media_number,
    18091809                                        MONDO_LOGFILE, message_to_screen);
     
    18241824#ifdef __IA64__
    18251825                log_msg(1, "IA64 --> elilo");
    1826                 mr_asprintf(&tmp2,"mkisofs -no-emul-boot -b images/mindi-bootroot.%s.img -c boot.cat -o _ISO_ -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .", bkpinfo->mrconf->mindi_ia64_boot_size);
     1826                mr_asprintf(&tmp2,"mkisofs -no-emul-boot -b images/mindi-bootroot.%s.img -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .", bkpinfo->mrconf->mindi_ia64_boot_size);
    18271827                res = eval_call_to_make_ISO(bkpinfo,
    18281828                                            tmp2,
     
    18371837                log_msg(1, "Non-ia64 --> lilo");
    18381838                res = eval_call_to_make_ISO(bkpinfo,
    1839                                             "mkisofs -b images/mindi-bootroot.2880.img -c boot.cat -o _ISO_ -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .",
     1839                                            "mkisofs -b images/mindi-bootroot.2880.img -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .",
    18401840                                            destfile,
    18411841                                            g_current_media_number,
     
    18471847                log_msg(1, "Isolinux");
    18481848                res = eval_call_to_make_ISO(bkpinfo,
    1849                                             "mkisofs -no-emul-boot -b isolinux.bin -boot-load-size 4 -boot-info-table -c boot.cat -o _ISO_ -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .",
     1849                                            "mkisofs -no-emul-boot -b isolinux.bin -boot-load-size 4 -boot-info-table -c boot.cat -o '_ISO_' -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ .",
    18501850                                            destfile,
    18511851                                            g_current_media_number,
     
    36193619        }
    36203620        mr_asprintf(&tmp,
    3621                  "grep 'afio: ' %s | sed 's/afio: //' | grep -vx '/dev/.*' >> /tmp/changed.files",
     3621                 "grep 'afio: ' %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> /tmp/changed.files",
    36223622                 MONDO_LOGFILE);
    36233623        system(tmp);
     
    36253625
    36263626        mr_asprintf(&tmp,
    3627                  "grep 'star: ' %s | sed 's/star: //' | grep -vx '/dev/.*' >> /tmp/changed.files",
     3627                 "grep 'star: ' %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> /tmp/changed.files",
    36283628                 MONDO_LOGFILE);
    36293629        system(tmp);
  • trunk/mondo/src/common/libmondo-devices.c

    r903 r914  
    11971197    paranoid_pclose(fin);
    11981198
    1199     mr_asprintf(&tmp, "%s | grep -w \"%s\" > /dev/null 2> /dev/null",
     1199    mr_asprintf(&tmp, "%s | grep -E \"^%s\" > /dev/null 2> /dev/null",
    12001200            SWAPLIST_COMMAND, device_with_space);
    12011201    mr_free(device_with_space);
  • trunk/mondo/src/common/libmondo-filelist.c

    r900 r914  
    516516
    517517
    518 /*
    519 int set_acl_list(char*masklist, char*acl_fname)
    520 {
    521   char*command;
    522   int retval=0;
    523  
    524   if (length_of_file(acl_fname) <= 0) { return(0); }
    525   log_msg(1, "FIXME - not using masklist"); 
    526   malloc_string(command);
    527   if (find_home_of_exe("setfacl"))
    528     {
    529       sprintf(command, "gzip -dc %s | setfacl --restore - 2>> %s", acl_fname, MONDO_LOGFILE);
    530       log_msg(1, "command = %s", command);
    531       retval = system(command);
    532     }
    533   mr_free(command);
    534   return(retval);
    535 }
    536 */
    537 
    538 
    539518int set_EXAT_list(char *orig_msklist, char *original_exat_fname,
    540519                  char *executable)
     
    689668int set_fattr_list(char *masklist, char *fattr_fname)
    690669{
    691     return (set_EXAT_list(masklist, fattr_fname, "setfattr"));
     670    if (find_home_of_exe("setfattr")) {
     671        return (set_EXAT_list(masklist, fattr_fname, "setfattr"));
     672    } else {
     673        log_msg(1, "ERROR: set_EXAT_list: setfattr doesn't exist");
     674        return(0);
     675    }
    692676}
    693677
     
    696680int set_acl_list(char *masklist, char *acl_fname)
    697681{
    698     return (set_EXAT_list(masklist, acl_fname, "setfacl"));
     682    if (find_home_of_exe("setfacl")) {
     683        return (set_EXAT_list(masklist, acl_fname, "setfacl"));
     684    } else {
     685        log_msg(1, "ERROR: set_EXAT_list: setfacl doesn't exist");
     686        return(0);
     687    }
    699688}
    700689
  • trunk/mondo/src/common/libmondo-tools.c

    r900 r914  
    404404#else
    405405    tmp = call_program_and_get_last_line_of_output
    406              ("free | grep \":\" | tr -s ' ' '\t' | cut -f2 | head -n1");
     406             ("free | grep ':' | tr -s ' ' '\t' | cut -f2 | head -n1");
    407407    avm += atol(tmp);
    408408    mr_free(tmp);
     
    11101110    log_msg(4, "Setting command to something");
    11111111    mr_asprintf(&command,
    1112              "grep -v \":\" /etc/fstab | grep -vx \"#.*\" | grep -w \"/boot\" | tr -s ' ' '\t' | cut -f1 | head -n1");
     1112             "grep -v ':' /etc/fstab | grep -vE '^#.*$' | grep -E \"[   ]/boot[     ]\" | tr -s ' ' '\t' | cut -f1 | head -n1");
    11131113    log_msg(4, "Cool. Command = '%s'", command);
    11141114    tmp = call_program_and_get_last_line_of_output(command);
     
    11271127            }
    11281128        } else {
    1129             mr_asprintf(&command, "mount | grep -w \"%s\"", tmp);
     1129            mr_asprintf(&command, "mount | grep -E '^%s'", tmp);
    11301130            log_msg(3, "command = %s", command);
    11311131            if (run_program_and_log_output(command, 5)) {
     
    12151215             ("mktemp -q /tmp/mojo-jojo.blah.XXXXXX");
    12161216    if (does_file_exist(config_file)) {
    1217         mr_asprintf(&command, "grep -vx '%s .*' %s > %s",
     1217        mr_asprintf(&command, "grep -vE '^%s .*$' %s > %s",
    12181218                label, config_file, tempfile);
    12191219        paranoid_system(command);
  • trunk/mondo/src/common/libmondo-verify.c

    r900 r914  
    7171    log_msg(1, "Now scanning log file for 'afio: ' stuff");
    7272    mr_asprintf(&command,
    73              "grep \"afio: \" %s | sed 's/afio: //' | grep -vx \"/dev/.*\" >> %s",
     73             "grep \"afio: \" %s | sed 's/afio: //' | grep -vE '^/dev/.*$' >> %s",
    7474             stderr_fname, afio_found_changes);
    7575    log_msg(2, command);
     
    8282    log_msg(1, "Now scanning log file for 'star: ' stuff");
    8383    mr_asprintf(&command,
    84              "grep \"star: \" %s | sed 's/star: //' | grep -vx \"/dev/.*\" >> %s",
     84             "grep \"star: \" %s | sed 's/star: //' | grep -vE '^/dev/.*$' >> %s",
    8585             stderr_fname, afio_found_changes);
    8686    log_msg(2, command);
     
    10721072             (int) (random() % 32767));
    10731073    mr_asprintf(&tmp,
    1074              "grep -x \"%s:.*\" %s | cut -d'\"' -f2 | sort -u | awk '{print \"/\"$0;};' | tr -s '/' '/' | grep -v \"(total of\" | grep -v \"incheckentry.*xwait\" | grep -vx \"/afio:.*\" | grep -vx \"dev/.*\"  > %s",
     1074             "grep -E '^%s:.*$' %s | cut -d'\"' -f2 | sort -u | awk '{print \"/\"$0;};' | tr -s '/' '/' | grep -v \"(total of\" | grep -v \"incheckentry.*xwait\" | grep -vE '^/afio:.*$' | grep -vE '^dev/.*$'  > %s",
    10751075             (bkpinfo->use_star) ? "star" : "afio", MONDO_LOGFILE,
    10761076             changed_files_fname);
  • trunk/mondo/src/mondoarchive/mondo-cli.c

    r900 r914  
    459459            mr_allocstr(bkpinfo->nfs_remote_dir,"/");
    460460        }
    461         mr_asprintf(&tmp, "mount | grep -x \"%s .*\" | cut -d' ' -f3",
     461        mr_asprintf(&tmp, "mount | grep -E '^%s .*$' | cut -d' ' -f3",
    462462                bkpinfo->nfs_mount);
    463463        mr_free(bkpinfo->isodir);
  • trunk/mondo/src/mondorestore/mondo-restore.c

    r900 r914  
    20462046        mr_asprintf(&acl_fname, ACL_BIGGLST_FNAME_RAW_SZ, ARCHIVES_PATH);
    20472047        mr_asprintf(&xattr_fname, XATTR_BIGGLST_FNAME_RAW_SZ, ARCHIVES_PATH);
    2048         tmp = find_home_of_exe("setfacl");
    2049         if (length_of_file(acl_fname) > 0 && tmp) {
     2048        if (length_of_file(acl_fname) > 0) {
    20502049            set_acl_list(biggies_whose_EXATs_we_should_set, acl_fname);
    20512050        }
    2052         mr_free(tmp);
    2053 
    2054         tmp = find_home_of_exe("setfattr");
    2055         if (length_of_file(xattr_fname) > 0 && tmp) {
     2051        if (length_of_file(xattr_fname) > 0) {
    20562052            set_fattr_list(biggies_whose_EXATs_we_should_set, xattr_fname);
    20572053        }
    2058         mr_free(tmp);
    20592054        mr_free(acl_fname);
    20602055        mr_free(xattr_fname);
     
    26242619
    26252620
     2621/**
     2622 * @brief Haha. You wish! (This function is not implemented :-)
     2623 */
     2624int
     2625restore_live_from_monitas_server(struct s_bkpinfo *bkpinfo,
     2626                                 char *monitas_device,
     2627                                 char *restore_this_directory,
     2628                                 char *restore_here)
     2629     /* NB: bkpinfo hasn't been populated yet, except for ->tmp which is "/tmp" */
     2630{
     2631    FILE *fout;
     2632    int retval = 0;
     2633    int i;
     2634    int j;
     2635    struct mountlist_itself the_mountlist;
     2636    static struct raidlist_itself the_raidlist;
     2637  /** malloc **/
     2638    char tmp[MAX_STR_LEN + 1];
     2639    char command[MAX_STR_LEN + 1];
     2640    char datablock[256 * 1024];
     2641    char datadisks_fname[MAX_STR_LEN + 1];
     2642    long k;
     2643    long length;
     2644    long long llt;
     2645    struct s_node *filelist = NULL;
     2646    assert(bkpinfo != NULL);
     2647    assert_string_is_neither_NULL_nor_zerolength(monitas_device);
     2648    assert(restore_this_directory != NULL);
     2649    assert(restore_here != NULL);
     2650
     2651    sprintf(tmp, "restore_here = '%s'", restore_here);
     2652
     2653    log_msg(2, tmp);
     2654
     2655    log_msg(2, "restore_live_from_monitas_server() - starting");
     2656    unlink("/tmp/mountlist.txt");
     2657    unlink("/tmp/filelist.full");
     2658    unlink("/tmp/biggielist.txt");
     2659    if (restore_here[0] == '\0') {
     2660        strcpy(bkpinfo->restore_path, MNT_RESTORING);
     2661    } else {
     2662        strcpy(bkpinfo->restore_path, restore_here);
     2663    }
     2664    log_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");
     2665    sprintf(tmp, "FYI - data will be restored to %s",
     2666            bkpinfo->restore_path);
     2667    log_msg(3, tmp);
     2668    log_msg(3, "FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI FYI");
     2669    sprintf(datadisks_fname, "/tmp/mondorestore.datadisks.%d",
     2670            (int) (random() % 32768));
     2671    chdir(bkpinfo->tmpdir);
     2672
     2673    sprintf(command, "cat %s", monitas_device);
     2674    g_tape_stream = popen(command, "r");    // for compatibility with openin_tape()
     2675    if (!(fout = fopen(datadisks_fname, "w"))) {
     2676        log_OS_error(datadisks_fname);
     2677        return (1);
     2678    }
     2679    for (i = 0; i < 32; i++) {
     2680        for (j = 0; j < 4; j++) {
     2681            for (length = k = 0; length < 256 * 1024; length += k) {
     2682                k = fread(datablock + length, 1, 256 * 1024 - length,
     2683                          g_tape_stream);
     2684            }
     2685            fwrite(datablock, 1, length, fout);
     2686            g_tape_posK += length;
     2687        }
     2688    }
     2689    paranoid_fclose(fout);
     2690    sprintf(command,
     2691            "tar -zxvf %s tmp/mondo-restore.cfg tmp/mountlist.txt tmp/filelist.full tmp/biggielist.txt",
     2692            datadisks_fname);
     2693    run_program_and_log_output(command, 4);
     2694    read_header_block_from_stream(&llt, tmp, &i);
     2695    read_header_block_from_stream(&llt, tmp, &i);
     2696
     2697    unlink(datadisks_fname);
     2698    read_cfg_file_into_bkpinfo(g_mondo_cfg_file, bkpinfo);
     2699    retval = load_mountlist(&the_mountlist, g_mountlist_fname); // in case read_cfg_file_into_bkpinfo   strcpy(bkpinfo->media_device, monitas_device);
     2700
     2701
     2702    load_raidtab_into_raidlist(&the_raidlist, RAIDTAB_FNAME);
     2703    iamhere("FIXME");
     2704    fatal_error("This will fail");
     2705    sprintf(command,
     2706            "grep -E '^%s.*$' %s > %s",
     2707            restore_this_directory, g_filelist_full, g_filelist_full);
     2708    if (system(command)) {
     2709        retval++;
     2710        log_to_screen
     2711            ("Error(s) occurred while processing filelist and wildcard");
     2712    }
     2713    iamhere("FIXME");
     2714    fatal_error("This will fail");
     2715    sprintf(command,
     2716            "grep -E '^%s.*$' %s > %s",
     2717            restore_this_directory, g_biggielist_txt, g_biggielist_txt);
     2718    if (system(command)) {
     2719        log_msg(1,
     2720                "Error(s) occurred while processing biggielist and wildcard");
     2721    }
     2722    sprintf(command, "touch %s", g_biggielist_txt);
     2723    run_program_and_log_output(command, FALSE);
     2724//  filelist = load_filelist(g_filelist_restthese);  // FIXME --- this probably doesn't work because it doesn't include the biggiefiles
     2725    retval += restore_everything(bkpinfo, filelist);
     2726    free_filelist(filelist);
     2727    log_msg(2, "--------End of restore_live_from_monitas_server--------");
     2728    return (retval);
     2729}
     2730
     2731/**************************************************************************
     2732 *END_RESTORE_LIVE_FROM_MONITAS_SERVER                                    *
     2733 **************************************************************************/
     2734
     2735
     2736
     2737
     2738>>>>>>> .fusion-droit.r913
    26262739extern void wait_until_software_raids_are_prepped(char *, int);
    26272740
  • trunk/mondo/src/mondorestore/mondo-rstr-tools-EXT.h

    r688 r914  
    99extern void kill_petris(void);
    1010extern int mount_cdrom(struct s_bkpinfo *bkpinfo);
    11 extern int mount_device(char *, char *, char *, bool);
    1211extern int mount_all_devices(struct mountlist_itself *, bool);
    1312extern void protect_against_braindead_sysadmins(void);
  • trunk/mondo/src/mondorestore/mondo-rstr-tools.c

    r903 r914  
    257257    mr_free(tmp);
    258258
    259     mr_asprintf(&command, "grep -x \"%s\" %s", file, list_fname);
     259    mr_asprintf(&command, "grep -E '^%s$' %s", file, list_fname);
    260260    mr_free(file);
    261261
     
    854854                mr_allocstr(bkpinfo->prefix, STD_PREFIX);
    855855            }
    856             /* We need to override prefix value in PXE mode as it's
    857              * already done in start-nfs */
    858             envtmp1 = getenv("imgname");
    859             if (envtmp1 == NULL) {
    860                 fatal_error("no imgname variable in environment");
    861             }
    862856            if (strstr(call_program_and_get_last_line_of_output
    863857               ("cat /proc/cmdline"), "pxe")) {
    864                     mr_allocstr(bkpinfo->prefix,envtmp1);
     858                /* We need to override prefix value in PXE mode as it's
     859                * already done in start-nfs */
     860                envtmp1 = getenv("imgname");
     861                if (envtmp1 == NULL) {
     862                    fatal_error("no imgname variable in environment");
     863                }
     864                mr_allocstr(bkpinfo->prefix,envtmp1);
    865865            }
    866866
     
    989989            log_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir);
    990990        }
    991         /* We need to override values in PXE mode as it's
    992          * already done in start-nfs */
    993         envtmp1 = getenv("nfsmount");
    994         if (envtmp1 == NULL) {
    995             fatal_error("no nfsmount variable in environment");
    996             }
    997         envtmp2 = getenv("dirimg");
    998         if (envtmp2 == NULL) {
    999             fatal_error("no dirimg variable in environment");
    1000         }
    1001991        if (strstr(call_program_and_get_last_line_of_output
    1002992           ("cat /proc/cmdline"), "pxe")) {
    1003                 mr_allocstr(bkpinfo->nfs_mount,envtmp1);
    1004                 mr_allocstr(bkpinfo->nfs_remote_dir,envtmp2);
     993            /* We need to override values in PXE mode as it's
     994            * already done in start-nfs */
     995            envtmp1 = getenv("nfsmount");
     996            if (envtmp1 == NULL) {
     997                fatal_error("no nfsmount variable in environment");
     998            }
     999            envtmp2 = getenv("dirimg");
     1000            if (envtmp2 == NULL) {
     1001                fatal_error("no dirimg variable in environment");
     1002            }
     1003            mr_allocstr(bkpinfo->nfs_mount,envtmp1);
     1004            mr_allocstr(bkpinfo->nfs_remote_dir,envtmp2);
    10051005        }
    10061006    } else if (bkpinfo->backup_media_type == iso) {
     
    10361036                /* Find out where it's mounted */
    10371037                mr_asprintf(&command,
    1038                         "mount | grep -w %s | tail -n1 | cut -d' ' -f3",
     1038                        "mount | grep -E '^%s' | tail -n1 | cut -d' ' -f3",
    10391039                        g_isodir_device);
    10401040                log_it("command = %s", command);
     
    12381238            mr_free(command);
    12391239        }
    1240         mr_asprintf(&command, "grep  -x \"/dev/.*\" %s > %s",
     1240        mr_asprintf(&command, "grep  -E '^/dev/.*$' %s > %s",
    12411241                g_biggielist_txt, g_filelist_imagedevs);
    12421242        paranoid_system(command);
     
    13681368        mr_free(tmp);
    13691369    } else {
    1370         mr_asprintf(&tmp, "ls /dev | grep -xq %ss[1-4].*", device);
     1370        mr_asprintf(&tmp, "ls /dev | grep -Eq '^%ss[1-4].*$'", device);
    13711371        if (!system(tmp)) {
    13721372            mr_free(tmp);
  • trunk/mondo/src/mondorestore/mondo-rstr-tools.h

    r688 r914  
    99void kill_petris(void);
    1010int mount_cdrom(struct s_bkpinfo *bkpinfo);
    11 int mount_device(char *, char *, char *, bool);
    1211int mount_all_devices(struct mountlist_itself *, bool);
    1312void protect_against_braindead_sysadmins(void);
  • trunk/mondo/src/restore-scripts/mondo/compare-me

    r588 r914  
    261261fi
    262262
    263 grep -v -x "Files [^:]*:-" /tmp/compare-me.log \
     263grep -v -E '^Files [^:]*:-$' /tmp/compare-me.log \
    264264| sort -u > /tmp/suspect.files
    265265
  • trunk/mondo/src/restore-scripts/mondo/make-me-bootable

    r687 r914  
    4242    partno=$root_part
    4343else
    44     driveline=`grep -w /boot $1`
    45     [ ! "$driveline" ] && driveline=`grep -w / $1`
     44    driveline=`grep -E '[   ]/boot[     ]' $1`
     45    [ ! "$driveline" ] && driveline=`grep -E '[     ]/[     ]' $1`
    4646    partno=`echo "$driveline" | cut -d' ' -f1 | awk -F "[a-z]" '{print $NF;}'`
    4747#    echo "driveline=$driveline --> partno=$partno"
  • trunk/tools/mvi

    r793 r914  
    1 gvim `egrep -ri -w $* . | egrep -v '\.svn|~:|Binary' | cut -d: -f1 | sort -u`
     1gvim `egrep -ri -w $* . | egrep -vi '\.svn|~:|binary|binaire' | cut -d: -f1 | sort -u`
  • trunk/website/support.shtml

    r794 r914  
    3939    <p>For commercial support contracts for Mondo Rescue please contact one of the following companies:
    4040    <ul>
    41             <li><b><a href="http://www.linagora.com/en">Linagora</a></b> - Contact: <a href="mailto:support_at_linagora.com">Support Service</a></li>
     41            <li><b><a href="http://www.linagora.com/en">Linagora</a></b> (France) - Contact: <a href="mailto:support_at_linagora.com">Support Service</a></li>
     42            <li><b><a href="http://www.tc2l.ca">TC2L</a></b> (Canada) - Contact: <a href="mailto:contact_at_tc2l.ca">Support Service</a></li>
    4243    </ul></p>
    4344    <p>For commercial enhancement and consulting services around Mondo Rescue,
Note: See TracChangeset for help on using the changeset viewer.