Skip to content

Instantly share code, notes, and snippets.

@aserrallerios
Last active October 19, 2022 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aserrallerios/e481cb9b6b6e0e229d5d446751a6ad48 to your computer and use it in GitHub Desktop.
Save aserrallerios/e481cb9b6b6e0e229d5d446751a6ad48 to your computer and use it in GitHub Desktop.
❯ rsync --version
rsync  version 3.2.6  protocol version 31
❯ rsync --dry-run -v --itemize-changes --stats --progress -rt --delete --iconv=utf-8-mac,utf-8 "freenas.local:/mnt/default/Nextcloud/data/yoli/files/" "/Volumes/SAMSUNG 970/backups/yoli/nextcloud/"
  • rt -> recursive + preserve update time
  • iconv -> this is required to avoid false positives filename changes if executed in mac

By default this configuration will update files if it either has different size or update time.

The drawback of this method is that folder renames are not detected, and they need to be sync'ed from scratch. The fuzzy option might be able to help with simple renames at the same folder level.

More resources: https://www.baeldung.com/linux/rsync-ignore-file-properties https://unix.stackexchange.com/questions/102211/rsync-ignore-owner-group-time-and-perms https://man.archlinux.org/man/rsync.1.en https://www.scivision.dev/rsync-to-exfat-drive/ https://lincolnloop.com/blog/detecting-file-moves-renames-rsync/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment