Can file modification dates only be transferred from source to dest?

Bo Berglund bo.berglund at gmail.com
Wed Jan 12 10:31:31 UTC 2022


On Wed, 12 Jan 2022 11:07:46 +0100, Bo Berglund <bo.berglund at gmail.com> wrote:

>BUT I have screwed up the copy command, I used this:
>
>time cp -rf /mnt/backup/* /mnt/data/nas/
>
>instead of the intended
>
>time cp -rfp /mnt/backup/* /mnt/data/nas/

After reading up a bit more and tested with selected copy of smaller directories
I found that this is the command to use in the original setting:

time cp -rf --preserve=timestamp /mnt/backup/* /mnt/data/nas/

This does not interfere with other file properties like owner etc.

>
>Question:
>Is there some way to run through the files and only transfer the timestamps to
>the already existing files? They are byte-by-byte exactly the same as the source
>files.

Would still be nice to know if there is some kind of timestamp-sync available,
which does not transfer file bodies which are the same size, but only changes
the timestamp.


>Or do I have to remove the result of the transfer from tonight and run it yet
>again with the correct command?
>This will lose me a few hours which I prefer not to.

I have done this for a few smaller dirs and it works fine AFAICT, but I still
have the very large file container of some 120 GB to process...


-- 
Bo Berglund
Developer in Sweden





More information about the ubuntu-users mailing list