Duplicating between systems

I am moving a set of files between 2 computers … A and B
I want to have an identical set on each system. A system has a full rsync backup
Total File size is > 1Tb.
When I uuse ‘rsync -rv A B --delete’ old unwanted files remain on the B system and I am trying to get a full duplication.
I could simply delete everything on the B system and then copy but that is a longer process.
Any ideas?

CloneZilla

use the option to save and restore partitions. for using and handling tutorials check their website, internet tutorials and youtube

I can recommend using syncthing … it uses bittorrent to sync between networked systems

rsync is quite overwhelming - so using a gui to create the scripts - grsync - may help you.

This may be no bug, but a feature of rsync :wink:
There are several --delete -options in rsync because rsync is used for a lot of things.

I suggest using the documentation of rsync yourself. This is one of the best i found.

man rsync
info rsync

example:

Prior to rsync 2.6.7, this option would have no effect unless --recursive was enabled.  Beginning with 2.6.7, deletions will also occur when  --dirs  (-d)
              is enabled, but only for directories whose contents are being copied.

If you’re investigating which files weren’t deleted, you can use the rsync documentation to find out why.

  • This could be due to permissions
  • or because rsync doesn’t delete directories when they should go away
  • or …

You have to look at individual examples.

But rsync is one of the most reliable programs I’ve seen.
:footprints:

THIS could never work :rofl: but:
rsync -rv --delete A B

2 Likes

Thank you … my error understood.

My goto backup/restore line.
--exclude can be changed to --exclude-from=/path/to/file/exclude.txt
a txt file with one directory per line.

rsync -ahvD --exclude={/dir1/*,/dir2} --info=progress2 --stats --delete --delete-excluded --force --partial SOURCE DESTINATION

# info and some extra options that might be useful, well, -x I guess. xD
'
--progress = copy with progress information
--stats = give some file-transfer stats
--delete = delete extraneous files from dest dirs
--force = force deletion of dirs even if not empty
--partial = keep partially transferred files
--numeric-ids = don't map uid/gid values by user/group name
a = keep permissions/recursive direcories etc (equals -rlptgoD)
h = human readable
v = verbose
l = copy symlinks as symlinks
x = don't cross filesystem boundaries
D = transfer character and block device files and transfer special files such as named sockets and fifos
'

Edit
Note that THIS WILL DELETE ALL OTHER FILES ON THE DESTINATION OTHER THAN WHAT YOU ARE TRANSFERING FROM SOURCE