Uhhhh!, I fucked up...
I got my Rsync settings muddled... and now I have to re-copy my data for lots of hours.
So, have I got this right? The dataset that you are copying from, will add that dataset name/folder in the destination?
so like:
server 1 rsync settings /mnt/pool/dataset name
server 2 rsync settings /mnt/pool/ -and it will create/overwrite the dataset name from server 1?
so if server 1 was deadpool/media
then server 2 would be creating/overwriting a media folder in server 2s destination like /mnt/ghost/(media folder created/overwritten)?
-
Its been a little bit since I've setup RSYNC but here's an example of a tested command I used (and verified worked) for RSYNC over SSH:
rsync -avzhP -e 'ssh -p 22' --delete --stats --log-file=/mnt/c/Users/test_sys/Desktop/backup-`date +"%F-%I%p"`.log /mnt/c/somefiles root@192.168.0.247:/mnt/test
This does a lot of things all at once but at the base of it this takes the someFiles folder (and contents) and copies it into the test dataset/direcotry on the server. I do not know if you can copy datasets themselves using RSYNC.
-
Why not use a replication task?
Yep that's a command misconfiguration. It sounds like your destination is set fine but your source is not. You're copying the music folder when you just want the contents to replicate to the other servers music dataset. Use "../music/*" as your source. The astrix wildcard will copy the contents of music not the music folder stopping the music/music directory error.
I've had experience dealing with this before
-
Sorry, I am probably being really thick here, but want to make sure we're talking about the same thing here...
Here's my Rsync module contents:
Ok, so on the source machine.
Name: Mark
path: /mnt/deadpool/Mark
access mode: read and write
user: root
group: wheel
on the destination machine.
Name: Mark
path: /mnt/2ndserver/Mark
access mode: read and write
user: root
group: wheel
So the question is, would this with the requisite rsync tasks, create a folder and files in destination of /mnt/2ndserver/Mark/ or in /mnt/2ndserver/Mark/Mark?
I mean I could probably just do a test I guess, but would be nice to have confirmation... I am confused right now. lol
-
So you're using a config file? I always do it manually with a single-line command in a executable script.
You would want it to be:
Source: /mnt/deadpool/Mark
Destination: /mnt/2ndserver
RSYNC will automatically check if the Mark folder exists in the destination and create/modify it accordingly. By specifying the Mark folder in the destination you're telling RSYNC to put the source Mark folder inside a destination Mark folder.
-
AAAARGGHHHH!! it's driving me insane... I just did another test, checked everything was OK, and then ran the rsync... it copied the folder over, but no files again.
[edit] Ahh fuck me.... I had it right all along, just realised it's because I have checked "delay updates", so it holds the files updating until the transfer is complete.... what a twat, lol
OK, so I have got it right, it was my own damn fault for not testing on a smaller dataset to start with... now I know I can fix it
-
This is why people test things before deploying them. Helps avoid issues like these.
-
I'll keep working on getting Rsync how I want it on a non or less vital dataset and on a test server I think... I'm being really thick-headed. I won't let it beat me though, lol
For now I am sticking with Freefilesync, for one because it's so versatile as you can include/exclude folders and such in filters and so on.
And I decided to move my 6TB USB external over to my desktop. Takes much less time to back stuff up then, and have easier access. I still have my server/NAS for remote access, so I'm covered either way.
Sorry for being so thick-headed with the Rsync... when you get it you get it, but until then it can be very confusing. I think the thing that threw me is I was also trying to rsync between the main server and the USB external attached to it in a new pool config. And the rsync method is different... well that's my excuse and I'm sticking to it
-
RSYNC does support excluding files/directories:
If you just want to exclude 1 file or directory you can add it into the rsync command:
rsync -avzhP --exclude 'file/directory' source/ destination/ Example: rsync -avzhP --exclude 'videos' /mnt/storage /mnt/backup
Do note if you used "/*" you could have kept your source and destination directories identical as the wildcard says copy everything inside the directory:
rsync -avzhP /mnt/server1/Mark/* /mnt/server2/Mark
/* says don't copy the Mark folder into the destination, copy everything inside Mark to the destination Mark folder.
If you want to exclude all of a file type:
rsync -avzhP --exclude '*.mp3' /mnt/storage/music/* mnt/backup/music
Exclude multiple directories with similar names:
rsync -avzhP --exclude 'tax*' /mnt/storage/taxes/* mnt/backup/taxes
You can use an absolute path to exclude a file:
rsync -avzhP --exclude 'mnt/storage/music/taylor_swift/lover.flac' /mnt/storage/music/taylor_swift/* mnt/backup/music/taylor_swift
NOTE: Excluding a single file in a path like this the file path needs to be relative so wherever you execute rsync is where it will start searching for the first directory in the exclusion path (ie. mnt/).
You can have more than one --exclusion in the command:
rsync -avzhP --exclude '*.mp3' --exclude '*.flac' /mnt/storage/music/* mnt/backup/music
Now if you have a whole list of random files to exclude you can create an exclusion file:
$ nano exclude-list.txt lover.flac *.txt storage/taxes/tax* not_porn
and put it in your command with --exclude-from:
rsync -avzhP --exclude-from 'exclude-list.txt' /mnt/storage/* mnt/backup
So you have quite a few options at your disposal
-
I will make a not of that, thank you...
TBH though, with my disabilities, trying to remember stuff like this is a very BIG challenge, so I'd have to make a note of it anyway and keep referring to it... I do like the exclude-list though. With my memory disability, I find it hard sometimes to remember what a bloody everyday object is, let alone remember CLI I try not to dwell on my disabilities, and try and focus on the good things I can still do... which is one reason why I still challenge myself with trying something new.. learning something new, even if it's small like setting up unraid (had to try and remember what it was called, lol), and I try to do stuff over again, so that I might remember it for next time, repetition is key for me with these problems.
So even though I kinds failed at using rsync in freenas, at least I can remember how to set up the modules, and rsync tasks... I just get confused about whether it creates that folder/dataset in the destination too. I will get there though.
For me, it's easier to use freefilesync gui from my desktop... I have used it for years, and don't have to think too hard about what I am doing as I've used it so much. Plus having the filter button there, to include/exclude files/folders is very easy... and I can save the config, to use again whenever... and can change stuff easily if I have to.
I will learn more about rsync, it does look like a handy thing to do for sure... just need to be in the right headspace to use it, was having a BAD day yesterday, and shouldn't have tried to do it I think. I will give it another shot when I feel a bit better... and do tests on a non[essential dataset and server/test pc when I get it set up again. I have added it to my "to-do" list, along with exploring ESXi some more and containers(forgot the name right now again).
Anyway, once again I thank you for trying to help me