bug-ddrescue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-ddrescue] Feature request: preserve source timestamp


From: Andrey Gursky
Subject: [Bug-ddrescue] Feature request: preserve source timestamp
Date: Fri, 21 Oct 2016 14:18:07 +0200

Hi,

I noticed, that once ddrescue has really finished (100%) with copying a
file, it doesn't set the destination timestamp to the source one (fully
available precision, e.g. nanoseconds for ext4).

In order to do this in a script, an informative exit status from
ddrescue would be needed, to easy distinguish between ddrescue is just
done with its passes and ddrescue has completely restored a file.

>From man:
> Exit status: 0 for a normal exit,
>              1 for environmental problems
>                (file not found, invalid flags, I/O errors, etc)

Maybe this would already fit the described purpose?

I've tried to use the safecopy's simulator [1], but ddrescue keeps to
loose the source file:

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

simulator.cfg:
blocksize=1024
filesize=102400
source=test.dat
softfailcount=2
softfail=5

$ dd if=/dev/urandom of=test.dat bs=1024 count=100
$ rm test.out test.out.mapfile
$ LD_PRELOAD=libsimulatorlb.so.1.0 ddrescue -v --cpass=1 debug test.out 
test.out.mapfile
simulator initialising - reading config simulator.cfg
simulator time granularity: 94 usecs
simulator everything shorter will be busy-waiting
simulator simulated blocksize: 1024
simulator simulated filesize: 102400
simulator opening data source: test.dat
simulator simulated soft error count: 2
simulator simulating soft error in block: 5
opening debug
seeking in debug: SEEK_END to 102400
GNU ddrescue 1.21
About to copy 102400 Bytes from debug to test.out.
    Starting positions: infile = 0 B,  outfile = 0 B
    Copy block size: 128 sectors       Initial skip size: 128 sectors
Sector size: 512 Bytes

Press Ctrl-C to interrupt
     ipos:        0 B, non-trimmed:        0 B,  current rate:       0 B/s
     opos:        0 B, non-scraped:        0 B,  average rate:       0 B/s
non-tried:   102400 B,     errsize:        0 B,      run time:          0s
     ipos:        0 B, non-trimmed:    60416 B,  current rate:    5120 B/s
     opos:        0 B, non-scraped:        0 B,  average rate:    5120 B/s
non-tried:    36864 B,     errsize:        0 B,      run time:          1s 0
  rescued:     5120 B,      errors:        0,  remaining time:         19sre 
and  reads 5120 bytes
percent rescued:   5.00%      time since last successful read:          0s

ddrescue: Input file disappeared: No such file or directory

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Thanks,
Andrey

[1] https://lists.gnu.org/archive/html/bug-ddrescue/2009-07/msg00027.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]