Changes between Initial Version and Version 2 of Ticket #14


Ignore:
Timestamp:
Mar 10, 2009, 1:14:47 PM (16 years ago)
Author:
rick
Comment:

You are right, part

# Compare files, ignore white spaces, modification, etc
diff -b -B -q ${SRC} ${DST}
if [ $? -eq 1 ]; then
  #XXX: When is disks is already mounted for some reason (other process, script call, make sure to keep it's previous state
  mount -uwo noatime /cfg
  cp ${SRC} ${DST}
  umount /cfg
fi

needs to include extra check on non existence

# Compare files, ignore white spaces, modification, etc
diff -b -B -q ${SRC} ${DST}; RETVAL=$?
if [ [ $RETVAL -ne 0 ]; then
  #2: DST does not yet, exists, 1: file differs
  #XXX: When is disks is already mounted for some reason (other process, script call, make sure to keep it's previous state
  mount -uwo noatime /cfg
  cp ${SRC} ${DST}
  umount /cfg
fi

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14 – Description

    initial v2  
    1919# Check whether target is writable
    2020if [ ! -w $DST ]; then
    21     echo "ERROR: '$DST' not writeable!" 1>&2
     21    echo "ERROR: '$DST' not writable!" 1>&2
    2222    exit $EX_CANTCREAT
    2323fi
    2424
    25 # Compare files, ignore white spaces, modification, etc
    26 diff -b -B -q ${SRC} ${DST}
    27 if [ $? -eq 1 ]; then
    28   #XXX: When is disks is already mounted for some reason (other process, script call, make sure to keep it's previous state
    29   mount -uwo noatime /cfg
    30   cp ${SRC} ${DST}
    31   umount /cfg
    32 fi
     25
    3326
    3427exit $EX_OK