...
Warning |
---|
Be very careful not to include a trailing slash in source and destination(maybe slash ok in destination but need to test) or you will end up deleting everything in your target. The trailing slash (/) on the source directory modifies the behaviour,
|
--archive = which includes,
...
--delete = delete any files not in the source
--sparse = --verbose =
--itemize-changes =
--human-readable =
--progress =
source = see what's happening
source = what you are syncing
destination = destination may be a directory but the most useful is actually to or another system running the rsync service
...
--password-file =
--log-file=
Straight Copy
Simple straight copy and can be used to resume (still need to modify for resume),
Code Block | ||
---|---|---|
| ||
rsync --archive --sparse --compress --verbose --itemize-changes --human-readable --progress /home/tempadmin/tmp/source /home/tempadmin/tmp/destination |
...
More Details Understanding of the Attributes
--archive
Same as -rlptgoD (no -H)
...
This option is useful for transfer of large files with block-based changes or appended data, and also on systems that are disk bound, not network bound.
Exclude Unnecessary Mac OS
...
Hidden Files
Within a script,
Code Block | ||
---|---|---|
| ||
# rsync can't handle spaces if just a variable https://stackoverflow.com/questions/19219774/bash-rsync-with-options-as-variable
EXCLUDE_ARRAY=("'$RECYCLE.BIN'" "'$Recycle.Bin'" "'.AppleDB'" "'.AppleDesktop'" "'.AppleDouble'" "'.com.apple.timemachine.supported'" "'.dbfseventsd'" "'.DocumentRevisions-V100*'" "'.DS_Store'" "'.fseventsd'" "'.PKInstallSandboxManager'" "'.Spotlight*'" "'.SymAV*'" "'.symSchedScanLockxz'" "'.TemporaryItems'" "'.Trash*'" "'.vol'" "'.VolumeIcon.icns'" "'Desktop DB'" "'Desktop DF'" "'hiberfil.sys'" "'lost+found'" "'Network Trash Folder'" "'pagefile.sys'" "'Recycled'" "'RECYCLER'" "'System Volume Information'" "'Temporary Items'" "'Thumbs.db'" "'DF'" "'Trash'" "'Folder'" "'Volume'" "'Information'" "'Items'") |
And then add the variable at the beginning of your execution line as follows,
Code Block | ||
---|---|---|
| ||
caffeinate -s rsync "${EXCLUDE_ARRAY[@]/#/--exclude=}" --archive ... |
You can also do this from the command line too, but the syntax will be different... (still to document).
Understanding the rsync Progress
...
Panel |
---|
|
Example output (and I'll add more details here),
Panel |
---|
|
Mac OS X to Errors
Use this only if things don't work on Mac OS X with the error message noted. On certain (I've yet to determine) versions of Mac OS X, restrictions have increased.
Special Character Issues btw UTF-8 Mac and UTF-8
...
Terminal Restriction
Before using rsync you need to lift FDA (full disk access) restrictions in System Preferences > Security & Privacy > Privacy > Full Disk Access and add Terminal otherwise you may see the error messages when trying to rsync.
...
Solution to FUSE or NFS on MAC - https://stackoverflow.com/questions/667992/rsync-error-failed-to-set-times-on-foo-bar-operation-not-permitted/668049#668049
Understanding what the Progress Bar Looks like - https://stackoverflow.com/questions/4493525/what-does-f-mean-in-rsync-logs
Special Character and Platform Difference Issues - https://askubuntu.com/questions/533690/rsync-with-special-character-files-not-working-between-mac-and-linux https://apple.stackexchange.com/questions/148799/rsync-with-linux-server-special-character-problem