This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

rsync of windows shortcuts creates foo and foo.lnk - never fully synchronizes


I am seeing strange rsync behavior in cygwin when synchronizing
directories that contain windows shortcuts.  When a shortcut foo.lnk
gets modified, rsync creates both a foo and foo.lnk file in the
receiving side.  Repeated runs of rsync print output as if the extra
file is removed, but it never really is.  The test case below
demonstrates the problem.

cygcheck.out attached.
I've been having this problem for a while - maybe a couple of years.

# create 2 working directories
mkdir /tmp/A
mkdir /tmp/B

# create a directory to sync
mkdir /tmp/A/foo

# create a shortcut
cd /tmp/A/foo
mkshortcut \
  --arguments="mintty" \
  --name="winshortcut" \
  --workingdir="$HOME" \
  /bin/run

# rsync 'foo' - works fine
rsync -rt --itemize-changes --update --delete /tmp/A/foo /tmp/B
# 2nd rsync does nothing - as expected
rsync -rt --itemize-changes --update --delete /tmp/A/foo /tmp/B

# files in each synced directory look fine - same time stamp and size
ls -l /tmp/A/foo
ls -l /tmp/B/foo

# touch the shortcut
touch /tmp/A/foo/winshortcut.lnk

# here is where the proble first happens I think
# rsync 'foo' - appears to work fine
rsync -rt --itemize-changes --update --delete /tmp/A/foo /tmp/B

# BUT ...
# something is wrong in directory B
# there is both a 'winshortcut' and 'winshortcut.lnk' file
ls -l /tmp/B/foo
> -rwx------ 1 fred None 371 Dec 18 11:26 winshortcut
> -rwx------ 1 fred None 371 Dec 18 11:26 winshortcut.lnk

# running rsync again deletes 'winshortcut' and syncs 'winshortcut.lnk'
rsync -rt --itemize-changes --update --delete /tmp/A/foo /tmp/B
> *deleting   foo/winshortcut
> >f..t...... foo/winshortcut.lnk

# this never resolves ...
# every time rsync is run it deletes 'winshortcut' and syncs 'winshortcut.lnk'
# both files are always present in B
rsync -rt --itemize-changes --update --delete /tmp/A/foo /tmp/B
ls -l /tmp/B/foo
# (run this rsync and ls repeatedly)

# clean up
rm -rf /tmp/A
rm -rf /tmp/B


Thanks,
Fred Wheeler

Attachment: cygcheck.out
Description: Binary data

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]