Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

Mac OS X to

...

Backup iPhoto

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.

For me, I ran into this challenge with my Photos Library, 

Code Block
building file list
rsync: opendir "/Users/tin.pham/Pictures/Photos Library.photoslibrary" failed: Operation not permitted (1)
1 file to consider
IO error encountered -- skipping file deletion
sent 102 bytes  received 16 bytes  21.45 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files could not be transferred (code 23) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-52.200.2/rsync/main.c(996) [sender=2.6.9]

After making the System Preferences change, it will ask you to restart your Terminal app for the changes to take effect. Here is how your Privacy will look after Terminal is added,

Image Added

NFS or FUSE File Restrictions

If copying to or copying from file systems that use NFS or FUSE, you may run into some trouble seeing set times.

Code Block
rsync: failed to set times on "."

You can suppress this with --omit-dir-times

Extended Attributes

--extended-attributes

Copy extended attributes and resource forks.

...

What to copy:
 -r, --recursive             recurse into directories
 -R, --relative              use relative path names
     --exclude=PATTERN       Exclude files matching PATTERN
     --exclude-from=FILE     Read exclude patterns from FILE
 -I, --ignore-times          Don't exclude files that match length and time
     --size-only             only use file size when determining if a file should be transferred
     --modify-window=NUM     Timestamp window (seconds) for file match (default=0)
     --include=PATTERN       Don't exclude files matching PATTERN
     --include-from=FILE     Read include patterns from FILE

How to copy it:  -n, --dry-run               Perform a trial run with no changes made
 -l, --links                 Copy symlinks as symlinks
 -L, --copy-links            Transform symlink into referent file/dir
     --copy-unsafe-links     Only "unsafe" symlinks are transformed
     --safe-links            Ignore links outside the destination tree
 -H, --hard-links            Preserve hard links
 -D, --devices               Preserve devices (super-user only)
 -g, --group                 Preserve group
 -o, --owner                 Preserve owner (super-user only)
 -p, --perms                 Preserve permissions
 -t, --times                 Preserve times
 -S, --sparse                Handle sparse files efficiently
 -x, --one-file-system       Don't cross filesystem boundaries
 -B, --block-size=SIZE       Force a fixed checksum block-size (default 700)
 -e, --rsh=COMMAND           Specify rsh replacement
     --rsync-path=PATH       Specify path to rsync on the remote machine
     --numeric-ids           Don't map uid/gid values by user/group name
     --timeout=TIME          Set IO timeout in seconds
 -W, --whole-file            Copy whole files, no incremental checks

Destination options:  -a, --archive               Archive mode
 -b, --backup                Make backups (see --suffix & --backup-dir)
     --backup-dir=DIR        Make backups into this directory
     --suffix=SUFFIX         Override backup suffix
 -z, --compress              Compress file data during the transfer
 -c, --checksum              Skip based on checksum, not mod-time & size
 -C, --cvs-exclude           Auto ignore files in the same way CVS does
     --existing              Only update files that already exist
     --delete                Delete files that don't exist on the sending side
     --delete-excluded       also delete excluded files on the receiving side
     --delete-after          Receiver deletes after transfer, not during
     --force                 Force deletion of directories even if not empty
     --ignore-errors         Delete even if there are IO errors
     --max-delete=NUM        Don't delete more than NUM files
     --log-format=FORMAT     Log file transfers using specified format
     --partial               Keep partially transferred files
     --progress              Show progress during transfer
 -P                          equivalent to --partial --progress
     --stats                 Give some file transfer stats
 -T  --temp-dir=DIR          Create temporary files in directory DIR
     --compare-dest=DIR      also compare destination files relative to DIR
 -u, --update                update only (don't overwrite newer files)

Misc Others:      --address=ADDRESS       bind to the specified address
     --blocking-io           Use blocking IO for the remote shell
     --bwlimit=KBPS          Limit I/O bandwidth, KBytes per second
     --config=FILE           Specify alternate rsyncd.conf file
     --daemon                Run as a rsync daemon
     --no-detach             Do not detach from the parent
     --password-file=FILE    Get password from FILE
     --port=PORT             Specify alternate rsyncd port number
 -f, --read-batch=FILE       Read batch file
 -F, --write-batch           Write batch file
     --version               Print version number
 -v, --verbose               Increase verbosity
 -q, --quiet                 Decrease verbosity
 -4, --ipv4                  Prefer IPv4
 -6, --ipv6                  Prefer IPv6
 -h, --help                  show this help screen

 


Warning

TBC - Roderick

References

...

Prevent MAC OX from sleeping - http://www.pcadvisor.co.uk/news/software/3382592/top-20-os-x-command-line-secrets-for-power-users/

Solution to OpenDir Error for Photos on Mac - https://www.reddit.com/r/MacOS/comments/bvo5wt/rsync_error_copying_libraryphotoslibrary/