I'm looking for a linux program that can mirror a directory to another drive and move a subdirectory in the mirror.

all 16 comments

sorted by: hot top controversial new old
[–] 10 points 3 years ago

Perhaps git would work?

  • source
  • [–] 8 points 3 years ago

    Syncthing is also an option.

  • source
  • [+] 6 points 3 years ago* (last edited 3 years ago)
    [–] 5 points 3 years ago

    But rsync can do this fine with --recursive --delete. The mirror will remain an exact replica.

  • source
  • [–] 5 points 3 years ago (1 child)

    lsyncd does just this. It's intended use is to sync directories between systems over slow(ish) uplink, but it can work locally as well. It takes some fiddling to set up, but once set up it just does it's thing seamlessly at the background. However if you're just looking for a backup solution I'd might look for something else, like a plain rsync script.

  • source
  • hideshow 2 child comments
  • [–] 4 points 3 years ago*

    I found an answer on StackExchange that refers to a tool called rsync-sidekick which looks like it could achieve your aims.

    Edit: There is also another answer on that same StackExchange page referring to a script called rsync-prepare which is capable of working with a remote destination.

  • source
  • [–] 2 points 3 years ago

    borg does this

  • source
  • [–] 2 points 3 years ago*

    I use RealTimeSync.

    It just... Works. I love it. It's free.

    There are plenty of features that could effectively let you do what you want.

    Mine is set to sync my server with a backup whenever my main PC is idle for 20 mins. Once it determines how to sync, it lets me review before syncing.

  • source
  • [–] 2 points 3 years ago (1 child)

    Why not maintain a soft or hard link?

  • source
  • hideshow 2 child comments
  • [–] 2 points 3 years ago

    Why not exclude the folder you want to move from the initial sync, and sync that folder separately to the final location?

  • source
  • [–] 1 point 3 years ago*

    rclone sync might be a acceptable?

    It doesn't move files from one dir to another but it would delete the old directory and recopy to the new directory.

    I think rsync has the same functionality but could be wrong

  • source
  • [–] 1 point 3 years ago

    As long as the backup system performs deduplication, it should be able to store the backup data efficiently even if the source files are constantly moved around or renamed.

    ZFS snapshots can perform deduplication. There is also ZBackup, which also has deduplication support.

  • source
  • [–] 1 point 3 years ago

    Restic, kopia, and Borg are all pretty good backup tools with deduplication built in, so they might be a good option if you're doing this for backup purposes?

  • source