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

Re: how to copy files



On Mon, May 15, 2017 at 04:57:35AM +0800, Long Wind wrote:
> I have a folder in hard drive and a backup of it is made in a USB disk

What type of file system is on the USB disk?  For backing up files
from a Unix file system, you really want a Unix file system on the
target device, not a FAT32 or NTFS file system.

> Now some new files are added to the folder in hard drive
> how to make the folder in USB disk the same as in hard drive?

cd /source &&
rsync -a . /target

> I want a program that can check the two folders
> if file size and file name are same, they are regarded as same
> if not, update is needed

Wait.  Please explain this part in more detail.

Let's say you have a file named thesis.txt on your hard drive, and it
is 4 bytes long, containing "foo" plus newline.  You copy this to the
USB disk.  Now you edit thesis.txt on the hard drive and change the
content to "bar" plus newline.

Both copies of thesis.txt have the same name and the same size.  But
the copy on the hard drive has a newer timestamp, and it has different
CONTENT.

Are you saying that you want rsync to IGNORE the different timestamp
and the different content, and skip this file, just because it has
the same size as the one on the USB disk?

Why would you want this behavior?


Reply to: