I'm resynchronizing my local Nextcloud directory after several months of it being offline. A while ago I lost a bunch of data on the server (don't ask) and ~3 different devices are way out of sync, so as a precautionary measure, I took a backup of the directory using btrfs subvolume snapshot.

Now I'd like to determine if there's anything in the backup that isn't in the partially-synchronized Nextcloud directory (which is at ~/ownCloud because I used to be on ownCloud), i.e. if anything was deleted. To test this out I used this rsync command:

$ rsync -rvcn /var/backups/btrfs-snapshot-before-resynchronize-owncloud/home/alex/ownCloud/photos/Black\ and\ White\ Photography\ \(Winter\ \'14-15\) /home/alex/ownCloud/photos/Black\ and\ White\ Photography\ \(Winter\ \'14-15\)

The path in /var/backups is the snapshot version, and the path in /home/alex is the "live" version.

Unfortunately, this prints out (as far as I can tell) every file in the directory. Take Black and White Photography (Winter '14-15)/19th.jpg - this file is in both directories. It is the same by every measure - according to stat, it has the same size and inode number, and md5sum gives the exact same hash.

Why is rsync insisting that all these files are different even though they clearly aren't?

  • I would put '/' at the end of both directory arguments. – J.J. Hakala Jun 3 '17 at 7:19
  • @J.J.Hakala UGHHHHHH. if you post that as an answer, I'll accept it. – strugee Jun 3 '17 at 7:21

Your command does not have trailing '/' in the directory arguments (at least the first one), so the rsync tries to copy the first directory as a new directory in to the second directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.