Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: copy only files that have changed?

  1. #11
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: copy only files that have changed?

    Quote Originally Posted by garyed View Post
    I understand that but what I don't understand is which of those switches tells it to copy only files that have changed. I've checked every one of those switches & I don't see any one of them that will do that. Is there something undocumented or can someone explain it to me?
    I think that is inherent in rsync itself. Those are the settings I've been using for years and it does copy only the files that have changed. However, I do know that using rsync by itself without any switches does nothing.

  2. #12
    Join Date
    Apr 2007
    Location
    South Carolina
    Beans
    985
    Distro
    Ubuntu Studio 16.04 Xenial Xerus

    Re: copy only files that have changed?

    Quote Originally Posted by papibe View Post
    This is how it works:

    It all start by making a full backup (or mirror) of your source directory. If you do a regular rsync again, you would update the destination, but the previous version of the backup-ed data would be overwritten.

    Another approach is to do a differential backup: leave the full backup intact, and create a new directory with only the content that has change on the source.

    A typical rsync implementation has this structure:
    Code:
    rsync -av --compare-dest=full_back_up  original_source/   new_differential_backup/
    rsync will follow this logic: (1) go to original_source and take the first file; (2) check if the file exist in the full_backup; (3) if exist and haven't change, stop and fetch the next file from original_source; (4) if it does not exist or has changed, then copy it into new_differential_backup.

    Does that clarify things a little bit?
    Regards.
    I think I understand now.
    That should actually do what I'm wanting to do then.
    I want to do incremental backups to a new directory each time so after one full backup I could use that backup directory for the "--compare-dest=" directory to find what has changed & the copy only the changed files to a new directory.
    Gary

    I wish I knew what I used to know before I knew what I didn't know.

  3. #13
    Join Date
    Apr 2007
    Location
    South Carolina
    Beans
    985
    Distro
    Ubuntu Studio 16.04 Xenial Xerus

    Re: copy only files that have changed?

    Quote Originally Posted by Lars Noodén View Post
    I think that is inherent in rsync itself. Those are the settings I've been using for years and it does copy only the files that have changed. However, I do know that using rsync by itself without any switches does nothing.
    That makes sense to me now. I always used the -u switch but its really not needed unless you want to make sure you don't overwrite any newer files that are already on the destination folder.
    Gary

    I wish I knew what I used to know before I knew what I didn't know.

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •