rsync, 'uid/gid impossible to set' cases cause future hard link failure, how to fix?
Use the --usermap and --groupmap rsync
options (this requires that both source and dest environments use version 3.1.0 or higher). In my case this won't work since my destination (WD MyCloud) uses 3.0.9.
OR
Change the rsync
source code with gcc running under cygwin (really not that hard with some C knowledge).
How does rsync preserve ownership when uid/gid differs?
Yes, by default rsync matches owners and groups by name. Details are in the docs for --numeric-ids
.
--numeric-ids
With this option rsync will transfer numeric group and user IDs rather than using user and group names and mapping them at both ends.
By default rsync will use the username and groupname to determine what ownership to give files. The special uid 0 and the special group 0 are never mapped via user/group names even if the
--numeric-ids
option is not specified.If a user or group has no name on the source system or it has no match on the destination system, then the numeric ID from the source system is used instead.
rsync
presumably uses getpwnam
and getgrnam
to look up the uid and gid associated with the user and group names.
Compare md5 of all files in directory excluding multiple hardlinks
Unlike softlinks, hardlinks are regular files, each points to same inode number and conceptually there are no original or duplicate hardlinks.
What you can do here is to use -samefile
with find
command to get all the same hardlinks, put into the ignorelist, and use this ignorelist to skip operation on duplicate.
touch /tmp/duplicates
find . -type f | while read f
do
if ! $(grep $f /tmp/duplicates &>/dev/null)
then
find . -samefile $f | grep -v $f >> /tmp/duplicates
# put md5sum procedure for $f here
fi
done
Related Topics
Script Produces Different Result When Executed by Bash Than by Cron
How to Scale Ejabberd Server MAChine on Centos to Handle 200 K Connections
Batch Remove Substring from Filename with Special Characters in Bash
How to Extract Patterns Form a Text Files in Shell Bash
How to Install Flash Builder 4 or a Flash Builder Plugin on Eclipse in Ubuntu 10.04
Delete Repeated Characters Without Back-Referencing with Sed
Ssh Times Out While Connecting via Ipv6 But Works with Ipv4
Assembly Call Subprograms Based on User Input
Cmsg_Nxthdr() Returns Null Even Though There Are More Cmsghdr Objects
Perl - Replace Every Nth (And Multiples) Occurrences of a Character with Another Character
Environment Variable Used in Shell Script Appear Blank in Log File When Run by Cron
Elegant Way to Set Base Address of Elf Image with Linux Binutils
Linux Randomly Deleted My File While Compiling What Do I Do
Gnu Assembler .Data Section Value Corrupted After Syscall
Bash Extglob Negate Not Working as I Expect
Terminate an Ongoing Qprocess That Is Running Inside a Qthread