how to tell rsync to preserve time stamp on files when source tree has a mounted point

Nasser

Related to this question

Short description of the problem:

When source tree has a mounted point inside it, then time stamps on files inside that mounted point when copied to target tree are not preserved even when using -a option

Detailed description:

Assume this is the source tree:

                       /home/                           /home/
                         |                                |
                        me/                             BACKUP/
                         |                                |
                    +----+----------+                +----+-------+
                    |    |          |                |    |       |
                 data/  foo.txt    boo.txt         data/ foo.txt boo.txt
                    |                                |
                   a.txt                           a.txt

where data/ above is mounted external USB disk. Everything is ext4 file system. Everything in source is owned my me.

BACKUP also happened to be a mount point, the backup USB disk.

After issuing this command rsync -av --delete /home/me/ /home/BACKUP/, I found that /home/BACKUP/data/ and everything below it has the current time stamp, as if these files were created now, and not the time stamp on the files in /home/me/data/. Other files and folders outside data did have the time stamp preserved OK.

Question is: How to use rsync in the above setting to tell it to preserve time stamps on all files and folders even on files and folders on a mounted point?

I am using:

>uname -a
Linux 3.5.0-17-generic #28-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux

>rsync -v
rsync  version 3.0.9  protocol version 30
h3rrmiller

from man rsync:

   -t, --times                 preserve modification times

EDIT - to improve on this answer since it is not immediately obvious why this did not help OP:

OP is copying files from one filesystem to another and wanting to preserve c-time. Most people understand c-time to mean "create time" which is incorrect on most UNIX/Linux systems (Windows filesystems track "creation" or "birth" times).

For the most part, in UNIX and Linux, c-time is the timestamp used to record the last inode 'C'hange. An inode changes if any of its attributes are updated:

OP cannot preserve the c-time of their file's when they are brought onto a new filesystem. The creation of these files in the new filesystems is one of the conditions listed above (creation of inode/file).

/EDIT

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Preserve directory tree while copying with rsync

分類Dev

Prevent updates to 'modified time' when copying files to a mounted Samba folder

分類Dev

How to tell what wake source is when Wake Source: Unknown

分類Dev

How to tell GCC to ignore warnings in some source files?

分類Dev

How can I preserve certain files when compiling as a single .exe?

分類Dev

How to log Serial data with time stamp?

分類Dev

How to stamp prompt at command execute time?

分類Dev

How is the time stamp number in /etc/shadow calculated?

分類Dev

How to rename files to exclude the datetime stamp?

分類Dev

rsync to copy files which has changed

分類Dev

How to include files that are excluded in an rsync

分類Dev

How to work with a Javascript +Date() numeric time stamp in Python?

分類Dev

How can I tell when a Layout (and all its child Views) has fully finished inflating?

分類Dev

Using multiple rsync processes with --remove-source-files

分類Dev

Getting rsync to delete source files that already exist on destination

分類Dev

Rsync copy only changed files; ignore file modification time stamps

分類Dev

How to tell if it's British Summer Time

分類Dev

How to tell if expression is evaluated at compile time or runtime?

分類Dev

how to preserve selection when sorting QTableView

分類Dev

gradle: Skipping task ':compileJava' as it has no source files

分類Dev

How can I store files in the mounted shared folder?

分類Dev

Can the time stamp of a Retweet be accessed?

分類Dev

When updating mysql table row, current_time_stamp updates as well

分類Dev

Is it possible to tell when /dev/kmsg has been ratelimited?

分類Dev

How can an optical drive function when mounted vertically?

分類Dev

Getting epoch time from gmt time stamp

分類Dev

Not Creating the File when source has 0 rows

分類Dev

How to tell when React updates the real DOM

分類Dev

How to find time stamp and decimal value reading from data stream in Java

Related 関連記事

  1. 1

    Preserve directory tree while copying with rsync

  2. 2

    Prevent updates to 'modified time' when copying files to a mounted Samba folder

  3. 3

    How to tell what wake source is when Wake Source: Unknown

  4. 4

    How to tell GCC to ignore warnings in some source files?

  5. 5

    How can I preserve certain files when compiling as a single .exe?

  6. 6

    How to log Serial data with time stamp?

  7. 7

    How to stamp prompt at command execute time?

  8. 8

    How is the time stamp number in /etc/shadow calculated?

  9. 9

    How to rename files to exclude the datetime stamp?

  10. 10

    rsync to copy files which has changed

  11. 11

    How to include files that are excluded in an rsync

  12. 12

    How to work with a Javascript +Date() numeric time stamp in Python?

  13. 13

    How can I tell when a Layout (and all its child Views) has fully finished inflating?

  14. 14

    Using multiple rsync processes with --remove-source-files

  15. 15

    Getting rsync to delete source files that already exist on destination

  16. 16

    Rsync copy only changed files; ignore file modification time stamps

  17. 17

    How to tell if it's British Summer Time

  18. 18

    How to tell if expression is evaluated at compile time or runtime?

  19. 19

    how to preserve selection when sorting QTableView

  20. 20

    gradle: Skipping task ':compileJava' as it has no source files

  21. 21

    How can I store files in the mounted shared folder?

  22. 22

    Can the time stamp of a Retweet be accessed?

  23. 23

    When updating mysql table row, current_time_stamp updates as well

  24. 24

    Is it possible to tell when /dev/kmsg has been ratelimited?

  25. 25

    How can an optical drive function when mounted vertically?

  26. 26

    Getting epoch time from gmt time stamp

  27. 27

    Not Creating the File when source has 0 rows

  28. 28

    How to tell when React updates the real DOM

  29. 29

    How to find time stamp and decimal value reading from data stream in Java

ホットタグ

アーカイブ