I have attached a patch that supports a new --direct-write option.
The result of using this option is to write directly to the destination
files, instead of a temporary file first.
The reason this patch is needed is for rsyncing to a device where the
device is full or nearly full.
Say that I
Perhaps, all that I need is a --delete-before-update option that just unlinks the
file before it
starts to write the temp file. Then we avoid the possible issues that you raised.
I can still see a case where --direct-write may be useful (read-write file in a
read-only dir), but
this is
Using rsync-2.4.6:
Is a times difference supposed to cause a write?
Also -t vs -I makes no difference.
Below shows the problem, I think:
[dmahurin@pc16 /tmp]$ mkdir x y
[dmahurin@pc16 /tmp]$ cp /bin/ls x
[dmahurin@pc16 /tmp]$ ls -l x/ls
-rwxr-xr-x1 dmahurin users 43024 Nov 13
My first problem is that I am writing to compact flash, so I want the minimal
number of writes.
My second problem is that the flash is of limited size, so I need some sort
of patch rsync that does not keep the old file before writing the new one.
My patch now just unlinks the file ahead, and
I have been using this simple patch enough that I know it works for my
purpose,
now I submit it here, for comments.
--delete-before-update
implies -W, unlinks the destination file just before the new (temporary)
file is written.
This would be used when writing to a small or near full medium