Can rsync be used to create and maintain an exact copy of a filesystem remotely, detecting owner or group or permission changes too?
My current "rsync --del --numeric-ids -a something/ root@host:/somewhere/" only syncs by time or (or --checksum). If, say, only owner changes nothing is syncd. The workaround is to delete everything and resync, wearing out the targets flash storage.
If not, is there another way?
My goal is to be able to have networked hdd with that is an exact duplicate and can simply be plugged into the source machine in the event of a device/fs failure, or (my main reason) to sync an embedded os accross the network that has had only minor (but numerous untracked) tweeks.
EDIT: Original command used root@host not user@host
-I
or-c
might do it, at the cost of a lot of extra reads & time (which at least are better than a lot of extra writes & time). But honestly I thought rsync already updated permissions by default with-p
(or anything that includes it, like-a
) – derobert May 23 '17 at 20:18user@host
, do you mean a non-root user? Only root can change ownership. – derobert May 23 '17 at 20:20rsync --del --numeric-ids -a /tmp/test root@host:/tmp
. – derobert May 23 '17 at 20:47