rsync version 2.6.6 protocol version 29
I meant whether this is the version of rsync that comes with Tiger. I guess the answer is yes. You shouldn't use it, its broken -- Google for
Tiger rsync or just search for rsync in either the
Mac OS X Tiger or the
Unix forums, e.g.:
http://discussions.apple.com/thread.jspa?threadID=404954
rsync -av
This is wrong.
For one thing, you're not telling rsync to take metadata into consideration. The Apple's version that comes with Tiger has an
-E or
--extended-attributes option for this, as do other alternative (better) implementations that try to fix it.
Second, you forgot to specify the
--delete flag. This is necessary to (quoting rsync's man page) "delete any files on the receiving side that aren't on the sending side". In Tiger Mail, each message is stored as a separate file in the filesystem. If you tell Mail to delete a message, the corresponding file in the filesystem will be deleted as well. If this message was already present the last time you used Mail on another machine, it'll be there again after synching with that machine (because you're telling rsync to not propagate file deletions). Worse yet, the message will be there but any references to it in the
HOME/Library/Mail/Envelope Index master index file and elsewhere would have been removed, and this is bad.
Another consequence of not using the
--delete flag is that you're likely to have "orphaned" account folders in
HOME/Library/Mail/ for any accounts you've deleted in Mail since you started to use rsync. For each mail account, Mail keeps a folder in HOME/Library/Mail/. The name of that folder begins with the account type, continues with the account user name, and ends with the incoming mail server, e.g.
HOME/Library/Mail/POP-username@mail.server.com. When an account is removed in
Mail > Preferences > Accounts, Mail removes the account from the preferences file
HOME/Library/Preferences/com.apple.mail.plist and deletes the associated
HOME/Library/Mail/POP-username@mail.server.com folder (and any mail within it). But if you later rsync HOME/Library/Mail/, without the
--delete flag, against a backup that obviously still has the HOME/Library/Mail/POP-username@mail.server.com account folder, that folder won't be deleted in the backup, thus effectively leaving it there forever, just as if it had never been deleted, despite the account itself has indeed been removed from the preferences file.
So, to summarize, here's the least you should do to fix your problem:
1. Make a backup of your current Mail data to a safe place in case any of the following steps goes wrong.
2. Use a better implementation of rsync than the one provided by Apple. For your purposes, I recommend the one provided by
Quinton Dolan. If you put it in /usr/bin, beware that it may be replaced by any future Apple Update; this may or may not be what you want. Alternatively, you may put it in /usr/local/bin, in which case you must ensure that the right version of rsync is called by your scripts.
3. Replace
rsync -av with:
rsync -av --extended-attributes --delete
or just
rsync -avE --delete
in all your scripts.
Additionally, you may also want to clean up your existing Mail data:
1. Quit Mail.
2. Look for any "orphaned" account folders in
HOME/Library/Mail/ and delete them. Do not delete anything you're not sure belongs to an already deleted mail account.
3. Read the article
Some mailbox files used by Mac OS X 10.3 are not deleted after importing. This article applies not only to mailbox (.mbox) folders within
HOME/Library/Mail/Mailboxes/, but also to any mailbox folders within each of the account specific folders (
HOME/Library/Mail/POP-username@mail.server.com). Basically, you can remove any files (not folders) found within any
.mbox folder except
Messages and
Info.plist (the article says you can also remove Info.plist files within .mbox folders, and in fact you
can, but Tiger Mail does use them and will recreate them if deleted, so there is no point in doing so).
4. Move the
HOME/Library/Mail/Envelope Index file to the Trash. This will cause Mail to recreate that file and reindex everything again the next time it's launched. I don't recommend doing this without having done step 3 first.
Note: As you can see, your problem is no walk in the park and I might very well have made a mistake in what I've written. Don't hesitate to ask if there is anything you don't understand or feel comfortable with.
ps: what ya doin' in barcelona?
Well, that's where I live (in Martorell, actually, a town 27 Km away).