UID -1 and --link-dest problem

Marcin Deranek marcin at ripe.net
Tue Jul 6 11:23:56 GMT 2004


Hi,

I'm not sure if it's rsync or Cygwin problem, but most probably both.. 
Here is a short description:

I run rsync daemon on Windows machine (either latest cwRsync or Cygwin 
versions) and synchronize a Windows directory to Linux server as root:

linux# rsync -avH --numeric-ids 10.0.0.1::test /export/test1/
receiving file list ... done
created directory /export/test1
./
43524353.upd
43534354.upd
<snip>

Directory is synced properly, but when I try to sync it again (nothing 
has changed on Windows machine since previous sync) using --link-dest to 
create 'hard-linked snapshot' directory is copied again (should be 
hard-linked) instead:

linux# rsync -avH --numeric-ids --link-dest=/export/test1/ 
10.0.0.1::test /export/test2/
receiving file list ... done
created directory /export/test2
./
43524353.upd
43534354.upd
<snip>

Looking closer I found out that because of UID change files are not 
hard-linked:
linux# rsync -avvvH --numeric-ids --link-dest=/export/test1/ 
193.0.2.129::test /export/test2/|grep uid
set uid of . from 0 to -1
set uid of 43524353.upd from 0 to -1
set uid of 43534354.upd from 0 to -1
<snip>

It looks like when rsync synchronised files for the first time (to 
/export/test1 directory) it created them with UID=0 (because rsync was 
ran as root) and then it tried to change UID to -1 (which means 'do not 
change it'). When it tried to synchronise it for the 2nd time (to 
/export./test2 directory with --link-dest option enabled) it compared 
existing UID (0) with received one (-1) and they did not match, so file 
was copied instead of hard-linked to the previous version.
Cheers,

Marcin


More information about the rsync mailing list