NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

JasonBMechDev's avatar
Apr 12, 2021
Solved

How to make RSync jobs not create extra subdirectory

While using RSync jobs, which I understand are supposed to be used between two ReadyNAS machines, I've encountered an annoying problem that I'd like to know if there were some way to fix. This problem could have serious business ramifications in the event of a data disaster. 

 

Let's assume I have a Share on NAS 1 called Folder123, and inside Folder123 there are a lot of important business documents. On NAS 2, I create a Share called Backup_Folder123, and I use an RSync backup job to move the data from NAS 1 to NAS 2. My issue is that, on NAS 2, instead of the data inside of Folder123 being moved into the Backup_Folder123 Share, it is moved into Backup_Folder123\Folder123\. We employ a large number of scripts and programs that point to specific locations on our network to function, and in the event of a disaster when I would need to start using NAS 2, that extra subdirectory would break many of our programs and scripts.

 

I have noticed that the Windows/NAS protocol works as I would like. It would take the data inside Folder123 and put it directly inside Backup_Folder123, for example, but this is supposedly slower. I've looked at the speeds for both, and I actually haven't noticed that much of a difference according to the mouse-over speed/time/remaining popup for jobs, but I haven't extensively or scientifically tested it. At any rate, would it be possible to move the data over RSync while still maintaining the tree shape?


  • JasonBMechDev wrote:

     

    Let's assume I have a Share on NAS 1 called Folder123, and inside Folder123 there are a lot of important business documents. On NAS 2, I create a Share called Backup_Folder123, and I use an RSync backup job to move the data from NAS 1 to NAS 2. My issue is that, on NAS 2, instead of the data inside of Folder123 being moved into the Backup_Folder123 Share, it is moved into Backup_Folder123\Folder123\.


    It sounds like you are running the backup job on NAS 1 (with a remote destination). If you run the backup job on NAS 2 (with a remote source) you'll find this doesn't happen.

     

    However, you can keep the backup job running on NAS 1.  You just need to apply step 16 in the guide here:  https://kb.netgear.com/29741/How-do-I-back-up-data-between-two-ReadyNAS-OS-6-systems-using-the-backup-manager  Note you only do step 16 when the backup is running with a local source.  One benefit of running the jobs on NAS 1 is that the NAS will make a snapshot first, and back up the snapshot.  So the backup will be coherent, even if someone is changing files on the source share while the backup is running.

     

    As an aside: If I am understanding your use case correctly, you want NAS 2 to be a mirror of NAS 1.  If that is the case, you definitely do want to use RSYNC (and not Windows backup). Windows backup will not remove files on NAS 2 when they've been deleted, moved, or renamed on NAS 1.  That will result in a lot of clutter on NAS 2 over time.  

     

    if you look on the advanced tab of an RSYNC backup job, you'll find a "remove deleted files on target" checkbox.  That will ensure that the destination matches the source when the backup completes. You won't find that option for the other backup protocols.  If you want to be able to recover deleted files and folders, you can enable snapshots on the destination share (and of course on the source share too).

1 Reply

Replies have been turned off for this discussion
  • StephenB's avatar
    StephenB
    Guru - Experienced User

    JasonBMechDev wrote:

     

    Let's assume I have a Share on NAS 1 called Folder123, and inside Folder123 there are a lot of important business documents. On NAS 2, I create a Share called Backup_Folder123, and I use an RSync backup job to move the data from NAS 1 to NAS 2. My issue is that, on NAS 2, instead of the data inside of Folder123 being moved into the Backup_Folder123 Share, it is moved into Backup_Folder123\Folder123\.


    It sounds like you are running the backup job on NAS 1 (with a remote destination). If you run the backup job on NAS 2 (with a remote source) you'll find this doesn't happen.

     

    However, you can keep the backup job running on NAS 1.  You just need to apply step 16 in the guide here:  https://kb.netgear.com/29741/How-do-I-back-up-data-between-two-ReadyNAS-OS-6-systems-using-the-backup-manager  Note you only do step 16 when the backup is running with a local source.  One benefit of running the jobs on NAS 1 is that the NAS will make a snapshot first, and back up the snapshot.  So the backup will be coherent, even if someone is changing files on the source share while the backup is running.

     

    As an aside: If I am understanding your use case correctly, you want NAS 2 to be a mirror of NAS 1.  If that is the case, you definitely do want to use RSYNC (and not Windows backup). Windows backup will not remove files on NAS 2 when they've been deleted, moved, or renamed on NAS 1.  That will result in a lot of clutter on NAS 2 over time.  

     

    if you look on the advanced tab of an RSYNC backup job, you'll find a "remove deleted files on target" checkbox.  That will ensure that the destination matches the source when the backup completes. You won't find that option for the other backup protocols.  If you want to be able to recover deleted files and folders, you can enable snapshots on the destination share (and of course on the source share too).

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More