Find the answer to your Linux question:
Results 1 to 3 of 3
I want to use rsync to copy photos from an SD card. The problem is that sometimes photos will be deleted from the SD card by a meddlesome kid, or ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User IsaacKuo's Avatar
    Join Date
    Feb 2005
    Location
    Baton Rouge, LA, USA
    Posts
    406

    How to tell rsync to NOT delete files


    I want to use rsync to copy photos from an SD card. The problem is that sometimes photos will be deleted from the SD card by a meddlesome kid, or on purpose to recover some storage space.

    Therefore, I do NOT want rsync to delete any files in the destination directory, if they don't exist in the source directory.

    By default rsync will delete files in the destination that don't exist in the source. As far as I can tell, there are various options to tell rsync when to delete them, but I don't see the option to tell rsync to not delete them at all.

    I *do* want rsync to overwrite files which exist in both, but differ. This will practically always be a case of overwriting a corrupted partial file (interrupted transfer).

    I *do* want rsync to skip files with matching date/time. There are a ton of files involved, and WIFI is slow, so I only want to transfer the new files.

    I do *not* want rsync to delete files in the destination, which don't exist in the source.

    Please help! I'm desperate for a solution.

    Thanks!
    Isaac Kuo, ICQ 29055726 or Yahoo mechdan

  2. #2
    Just Joined!
    Join Date
    Sep 2013
    Location
    Hyderabad
    Posts
    29
    What are the commands you used to do rsync ?

  3. #3
    Linux User IsaacKuo's Avatar
    Join Date
    Feb 2005
    Location
    Baton Rouge, LA, USA
    Posts
    406
    Okay, I figured it out by ignoring the documentation and experimenting around...

    I normally use rsync -tvlr --delete source dest

    I tried out using rsync -tvlr source dest and it worked. It does NOT delete files in the dest folder, even if they no longer exist in the source folder.
    Isaac Kuo, ICQ 29055726 or Yahoo mechdan

  4. $spacer_open
    $spacer_close

Posting Permissions

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