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

  • @Fishy
    link
    English
    101 year ago

    Perhaps git would work?

  • @JubilantJaguar
    link
    English
    51 year ago

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

  • @[email protected]
    link
    fedilink
    English
    51 year ago

    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.

    • Nine
      link
      English
      31 year ago

      This is the best answer. I use it regularly to keep hundreds of TB in sync across nodes. Works extremely well and is pretty much hands off once setup.

  • @foggy
    link
    English
    2
    edit-2
    1 year 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.

  • @[email protected]
    link
    fedilink
    English
    21 year ago

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

  • @xinaked
    link
    English
    21 year ago

    borg does this

  • @SpaceNoodle
    link
    English
    21 year ago

    Why not maintain a soft or hard link?

    • @[email protected]OP
      link
      fedilink
      English
      11 year ago

      I am trying to create a crontab to backup multiple directory in which files change their location, but I don’t know if links would solve it

      • @SpaceNoodle
        link
        English
        1
        edit-2
        1 year ago

        You can also have rsync exclude specific files, so you could sync the main dir first, then the special subdir specifically

  • @[email protected]
    link
    fedilink
    English
    11 year 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?

  • @[email protected]
    link
    fedilink
    English
    11 year 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.

  • @vynlwombat
    link
    English
    1
    edit-2
    1 year 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