0

I want to use rsync (I'm actually using Grsync) to backup my home folder. The final command I decided to use is:

rsync -r -t -p -v --progress --delete -l -s --exclude-from [MY_FILE_WITH_EXCLUSIONS] --human-readable /home/myusername/ /mnt/Device/backupHome/

the problem is that, even after running the synch, a see a huge list of files and folders while running the dry-run (-n) with Grsync and a recap like this:

sent 656.77K bytes  received 32.61K bytes  141.82K bytes/sec
total size is 2.2G  speedup is 5,665.39 (DRY RUN)

Now that's something not very useful for me. I'd like it to show something more meaningful.

For example I'd like not to see the list of up-to-date files/folders, I guess it's better to see just the list of files/folders that are going to be sent to the receiver and also the size of them. Then the total final size of all files/folders that are being sent and the one of those that are being removed on the receiver would be something else very useful to me.

What options do I have? Is there perhaps any options of Grsync that might be handful for that case? Or at least any smart idea to improve rsync dry-run results?

Thanks

Frank
  • 283

1 Answers1

1

I'd like not to see the list of up-to-date files/folders, I guess it's better to see just the list of files/folders that are going to be sent to the receiver and also the size of them.

This is what will happen. Before you perform the synchronisation there will be the full set of files to transfer, and this is what --dry-run will show. After you have run a successful synchronisation there will be very few files changed in the source, so --dry-run will show just those files.

If this is not what you are finding then perhaps your target filesystem can't hold the time and permission attributes you're wanting to copy, so rsync sees that the files aren't correct and need re-copying.

For a native filesystem, I'd recommend you keep it simple and use something like this

rsync -avhHP --delete -exclude-from MY_FILE_WITH_EXCLUSIONS "$HOME"/ /mnt/Device/backupHome/

For a non-native filesystem such as NTFS you will have problems with metadata. For example, files and directories on an NTFS filesystem will appear to have full rwx permissions for everyone (0777) regardless of the permissions on the source, and this will trigger a recopy of the metadata each time rsync is used. In this instance you may need either to use --fake-super or exclude permissions and ownerships

mount -o acl,rw /dev/DEVICE /mnt/Device                                          # Include "acl"
rsync -aivHP -M--fake-super --delete SOURCE/ /mnt/Device/DESTINATION/            # Backup
rsync -aivHP --fake-super -M--super /mnt/Device/DESTINATION/ RESTORED_SOURCE/    # Recovery
Chris Davies
  • 4,560