RSync copy to dataset root directory instead of folder - copies system data?

jhl

Dabbler
Joined
Mar 5, 2023
Messages
27
Migrating data from a backup server back to my primary server after rebuilding a pool. I'm using Rsync and when I set up an Rsync module on MainServer/MainPool/Dataset1 and execute a Push task on my backup server to copy from BackupServer/BackupPool/Dataset1 to that module the items end up copied to:

MainServer/MainPool/Dataset1/Dataset1

I did some research and found the / modifier can prevent Rsync from creating this extra folder. Sounds good, except when I enter / in the Additional Parameters section in the GUI it ends up copying the intended folders as well as invisible folders I did not create, like "bin" "boot" "compat" "data" "dev" etc... I recognize most of these as Unix system folders so I'm not shocked to see them, but why are they getting copied? More importantly, what can I do to copy all my data direct to /MainServer/MainPool/Dataset1 without the sub-folder and without these extra folders?

I can manually move the files out of the sub-folder of course but I want to reverse this task once my main system is rebuilt so my backup server can keep updated copies of new files on the main server and if Rsync is always going to create folders of folders, this is going to get complicated...
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
The syntax you are looking for is;

rsync -aAHXx /mnt/BackupServer/BackupPool/Dataset1/ /mnt/MainServer/MainPool/Dataset1/

Note the trailing slash after each path.


As for the GUI, I don't know how to make it work the way you want.
 

jhl

Dabbler
Joined
Mar 5, 2023
Messages
27
Thank you!

Adding the slash after the path ended up fixing my problem. I was able to make that change in the GUI no problem. Interestingly - I did not need to modify the path in the RSync module (the target on the destination server) I only needed to modify it in the RSync task for the system sending the data.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
Glad you got it working.

RSync is quite powerful and has active development, (so it should be relatively bug free). I use it for some of my backups and I am happy with it.
 
Top