Hi! I've been attempting to use rsync to sync a set of files between my laptop and my desktop. I've tried using google to search the archives, but didn't find anything that addressed this issue exactly... First of all, here are the details of how I have things set up. Server acting as the intermediary: OS: Mac OS X Server 10.3 rsync: 2.6.2 Laptop: OS: Mac OS X 10.3.6 rsync: 2.6.2 Desktop: OS: Mac OS X 10.3.6 rsync: 2.6.3 On both machines I have a folder located at ~/Sync. This folder contains symlinks to the files I want sync'd: lrwxr-xr-x 1 username staff 54 7 Nov 00:24 AddressBook -> /Users/username/Library/Application Support/AddressBook lrwxr-xr-x 1 username staff 52 7 Nov 00:25 Adium 2.0 -> /Users/username/Library/Application Support/Adium 2.0 lrwxr-xr-x 1 username staff 45 7 Nov 00:25 Bookmarks.plist -> /Users/username/Library/Safari/Bookmarks.plist lrwxr-xr-x 1 username staff 32 7 Nov 00:25 Calendars -> /Users/username/Library/Calendars lrwxr-xr-x 1 username staff 39 7 Nov 00:04 StickiesDatabase -> /Users/username/Library/StickiesDatabase -rw-r--r-- 1 username staff 14142 7 Nov 00:05 Sync_From_Log.txt -rw-r--r-- 1 username staff 1945 7 Nov 00:26 Sync_To_Log.txt AddressBook, Adium 2.0, and Calendars are all directories. Bookmarks.plist and StickiesDatabase are files. The command I'm using to sync to the server: rsync -avzL -e ssh --exclude ".DS_Store" /Users/username/Sync username@the.server.address:~/ This works perfectly and does exactly what I want. The command I'm using to sync from the server: rsync -avzL -e ssh --exclude ".DS_Store" username@the.server.address:~/Sync /Users/username/ This works as expected for the folders (the symlinks remain intact at ~/Sync on the local machine and the linked locations are updated), but the symlinks to files are simply replaced with the copies from the server rather than the linked locations being replaced. For the life of me, I can't figure out why individual file symlinks are treated differently from folder symlinks. What I'm suspecting right now is that it has something to do with the -L option, but I couldn't seem to find anything detailing this specific situation online or in the man file. Any help would be greatly appreciated. I've spent many a long hour trying to work this out to no avail. Thanks! -Joel "Smiting his breast, he reproached his heart with word. Endure, heart; you have endured worse before." - Odyssey, XX 17-18
Not sure if it matters or not, but are you using the hfs+ version of rsrync? If not, you definitely should do that no matter what. John On Sun, 7 Nov 2004 13:51:40 -0800, Joel Watson <rsync@joelmwatson.com> wrote:> Hi! > > I've been attempting to use rsync to sync a set of files between my > laptop and my desktop. I've tried using google to search the archives, > but didn't find anything that addressed this issue exactly... First of > all, here are the details of how I have things set up. > > Server acting as the intermediary: > OS: Mac OS X Server 10.3 > rsync: 2.6.2 > > Laptop: > OS: Mac OS X 10.3.6 > rsync: 2.6.2 > > Desktop: > OS: Mac OS X 10.3.6 > rsync: 2.6.3 > > On both machines I have a folder located at ~/Sync. This folder > contains symlinks to the files I want sync'd: > > lrwxr-xr-x 1 username staff 54 7 Nov 00:24 AddressBook -> > /Users/username/Library/Application Support/AddressBook > lrwxr-xr-x 1 username staff 52 7 Nov 00:25 Adium 2.0 -> > /Users/username/Library/Application Support/Adium 2.0 > lrwxr-xr-x 1 username staff 45 7 Nov 00:25 Bookmarks.plist -> > /Users/username/Library/Safari/Bookmarks.plist > lrwxr-xr-x 1 username staff 32 7 Nov 00:25 Calendars -> > /Users/username/Library/Calendars > lrwxr-xr-x 1 username staff 39 7 Nov 00:04 StickiesDatabase -> > /Users/username/Library/StickiesDatabase > -rw-r--r-- 1 username staff 14142 7 Nov 00:05 Sync_From_Log.txt > -rw-r--r-- 1 username staff 1945 7 Nov 00:26 Sync_To_Log.txt > > AddressBook, Adium 2.0, and Calendars are all directories. > Bookmarks.plist and StickiesDatabase are files. > > The command I'm using to sync to the server: > > rsync -avzL -e ssh --exclude ".DS_Store" /Users/username/Sync > username@the.server.address:~/ > > This works perfectly and does exactly what I want. > > The command I'm using to sync from the server: > > rsync -avzL -e ssh --exclude ".DS_Store" > username@the.server.address:~/Sync /Users/username/ > > This works as expected for the folders (the symlinks remain intact at > ~/Sync on the local machine and the linked locations are updated), but > the symlinks to files are simply replaced with the copies from the > server rather than the linked locations being replaced. For the life of > me, I can't figure out why individual file symlinks are treated > differently from folder symlinks. What I'm suspecting right now is that > it has something to do with the -L option, but I couldn't seem to find > anything detailing this specific situation online or in the man file. > Any help would be greatly appreciated. I've spent many a long hour > trying to work this out to no avail. Thanks! > > -Joel > > "Smiting his breast, he reproached his heart with word. > Endure, heart; you have endured worse before." - Odyssey, XX 17-18 > > -- > To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync > Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html >
On Sun, Nov 07, 2004 at 01:51:40PM -0800, Joel Watson wrote:> [The -L] works as expected for the folders (the symlinks remain intact > at ~/Sync on the local machine and the linked locations are updated)That is not what -L does. It was an unintended side-effect on older rsync versions that -L affected operations on the receiving side, but its only purpose is to transform symlinks on the sending side into the referent files/dirs. In 2.6.3, the unintended side-effect on the receiving side went away and got its own option: --keep-dirlinks (-K). There has never been an rsync option to update local files in the spot where a symlink points. You probably thought it worked only because the unintentional -L side-effect could deceive you if the files were identical: no update occurs when they are the same, but when they differed, the symlink was replaced with the real file from the sender. In 2.6.3 this was fixed so that a local symlink is always replaced if the remote name is a file (or points to a file w/-L) rather than a symlink. The -K option can also be used to allow redirected directories on the local system. As long as the symlinks dir has matching symlinks (i.e. the referent files aren't in different places on each machine), you can use the --files-from option to update both the directories and the files without the symlink directory: cat <<EOT Library/Application Support/AddressBook Library/Application Support/Adium 2.0 Library/Safari/Bookmarks.plist Library/Calendars Library/StickiesDatabase EOT >file-list rsync -av --files-from=file-list remote:/Users/username /Users/username You can even use a file-list on the remote machine: rsync -av --files-from=:/path/file-list file-list remote:/Users/username /Users/username (The leading ':' is a shorthand for a matching "remote:" prefix for the files-from file.) ..wayne..