Skip to content

Accident caused by --remove-source-files #190

Closed

Description

@huangyingw

when I used --remove-source-files in following way:

rsync --remove-source-files source_dir/ target_dir/

there is a great danger:
if I Accidentally run it with source_dir === target_dir, or source_dir is just a symbol link to target_dir,
then both the source_dir and target_dir would be clean, empty, all the Contents under these dir would be gone.

Is there any pre-check for --remove-source-files, to prevent this case?

Activity

  1. WayneD commented on Jun 17, 2021

    @WayneD
    Member

    Only in your own brain. When prepping an rsync, it's often good to use option -ai and --dry-run (-n) to see what's going to happen. If you pointed it at the same source/dest files, it would show that there was nothing to copy, which should be a red flag.

  2. locked and limited conversation to collaborators on Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions