The problem I have with rsync
I keep almost all my important data on a NFS share in my local home network. For redundancy I use a USB drive that mirrors the data from the NFS with rsync
. I use the following command:
rsync -avPn --delete /Volumes/NFS /Volumes/USB 2>&1 | \
tee "/tmp/rsync-logs/"`date +"%Y-%m-%d_%H-%M-%S"`".txt"
This command builds a file list which takes about 10 minutes and the -n
or --dry-run
flag simulates what would be added and deleted on the USB drive. stdout
and stderr
are also piped to a log file for documentation purposes. When I inspected the output and made sure that I want to perform the operation, I execute the command without the -n
flag which takes another 10 minutes to build the file list. My ideal solution would be to somehow cache the dry-run output. There is a possible solution but I think it is too error prone and that some edge cases haven’t been considered.