-
I have a question you might be able to answer. Do you know if RSYNC cares if the receiving side is a dataset but the sending side is a normal folder? I need to create zfs datasets but when I go to sync with my backup I don't know if RSYNC will freak-out that there's a dataset folder with the same directory name and attempt to make a second or if it'll just use the dataset folder that's already there.
-
Umm, it's impossible for there to be two identical directories as either the mount path will be different or something identifying the path as a different host, such as the case of doing it over ssh. Also as far as Linux itself is concerned, a dataset is a directory/folder.
This is the tldr for rsync which may help. More details on the options themselves in the man page ofc.
~ ❯ tldr rsync rsync Transfer files either to or from a remote host (not between two remote hosts). Can transfer single files, or multiple files matching a pattern. - Transfer file from local to remote host: rsync path/to/local_file remote_host:path/to/remote_directory - Transfer file from remote host to local: rsync remote_host:path/to/remote_file path/to/local_directory - Transfer file in [a]rchive (to preserve attributes) and compressed ([z]ipped) mode with [v]erbose and [h]uman-readable [p]rogress: rsync -azvhP path/to/local_file remote_host:path/to/remote_directory - Transfer a directory and all its children from a remote to local: rsync -r remote_host:path/to/remote_directory path/to/local_directory - Transfer directory contents (but not the directory itself) from a remote to local: rsync -r remote_host:path/to/remote_directory/ path/to/local_directory - Transfer a directory [r]ecursively, in [a]rchive to preserve attributes, resolving contained soft[l]inks , and ignoring already transferred files [u]nless newer: rsync -rauL remote_host:path/to/remote_file path/to/local_directory - Transfer file over SSH and delete local files that do not exist on remote host: rsync -e ssh --delete remote_host:path/to/remote_file path/to/local_file - Transfer file over SSH and show global progress: rsync -e ssh --info=progress2 remote_host:path/to/remote_file path/to/local_file
-
The plan is:
- Create the pool
- Create the datasets
- RSYNC backup server to primary server
Because I was using Windows Server 2016 the backup server doesn't use datasets it's just normal folders so I wanted to ask if RSYNC would do anything funny if I pre-create datasets then copy the original structure over those.
Beyond this the plan is to switch over to using zfs send once I learn how to use it.
-
Nah, you won't have any issues. Just take note of these two examples:
- Transfer a directory and all its children from a remote to local: rsync -r remote_host:path/to/remote_directory path/to/local_directory - Transfer directory contents (but not the directory itself) from a remote to local: rsync -r remote_host:path/to/remote_directory/ path/to/local_directory
Make sure you have trailing slash like in the second example to only move the contents of the folder to the dataset and not the folder itself into the dataset.
-
Good god mounting a smb share via cli is a right PITA. The command itself wasn't bad but either I'm bad at google or there's just no good documentation on how to do it.
For future reference:
mkdir /local/mount/path sudo apt install cifs-utils sudo mount -t cifs -o username=username //IP/share /local/mount/path
-
It's the Arch Wiki but it's useful for other distros as well. https://wiki.archlinux.org/index.php/Samba#Manual_mounting
Usually it's my go to for finding things. Plus I use DuckDuckGo so I can just use !aw search term to automatically search the wiki.