Rsync sometimes because the server time is wrong, you need to change the time of the file modification, you can use the Touch command to modify the file's modified time:
1 touch-c-m-t 201101110000 teadme.txt
Modified Readme.txt to January 11, 2011:00 Modified
If you modify files and directories in bulk, use the
1 find/home/www/site-exec touch-c-m-t 201101110000 {} \;
You can change all the files and directories under the/home/www/site to modify the time.
Note the spaces in the command above.
Touch [-ACDMT] File parameters:
-A: Modify access time only.
-C: Only time is modified, not files are created.
-D: You can follow the date later, or you can use the –date= "date or time"
-M: Modify Mtime only.
-T: can be followed by time, in the form [YYMMDDHHMM]
such as Touch-c-T 0906270730 file
Usage:touch [OPTION] ... FILE ...
Update the access and modification times of all FILE to the current time.
Mandatory arguments to long options are mandatory for short options too.
-A change is the access time
-c,–no-create do don't create any files
-d,–date=string parse STRING and use it instead
-F (ignored)
-M modification Time
-r,–reference=file Use this FILE "s times instead of
-T STAMP use [[CC]YY]MMDDHHMM[.SS] instead of
–time=word Change the specified time:
WORD is access, atime, or Use:equivalent to-a
WORD is modify or mtime:equivalent to-m
–help Display this Help and exit
–version output version information and exit
Note that the-d and-t options accept different time-date formats.
If a FILE is-, touch standard output.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/